-
Notifications
You must be signed in to change notification settings - Fork 5
console.py
The Console
class is part of the LILY-QML project, developed by Leon Kaiser, and serves as a command-line interface for interacting with the LLY-DML module. This class provides a user-friendly, text-based interface to access and manage various functionalities, such as training models, testing models, and generating reports. The Console
class is highly interactive, guiding users through a structured menu system and providing distinct options for each primary functionality of the LLY-DML system.
- Project: LILY-QML
- Version: 2.0.0
- Author: Leon Kaiser
- Contact: info@lilyqml.de
- Website: www.lilyqml.de
The Console
class presents a command-line interface with multiple menus, allowing the user to:
- Train models with different optimizers.
- Test models and log results.
- Generate detailed reports on training and testing.
-
banner
:str
- A formatted ASCII banner displaying the LILY-QML branding.
-
info
:str
- A formatted informational string containing details about the LLY-DML version and project contact information.
Displays the main menu with options for training, testing, report generation, and program exit. The method clears the terminal screen and outputs the ASCII banner and project information followed by menu options.
Clears the terminal and displays options specific to training models. Options include:
- Training all optimizers.
- Training specific optimizers.
- Exiting to return to the main menu.
Clears the terminal and displays options for testing models. Options include:
- Starting the testing process and writing results to
test_data.json
. - Exiting to return to the main menu.
Clears the terminal and displays options for generating reports. Options include:
- Creating a training report.
- Creating a test report.
- Creating a combined report for training and testing.
- Exiting to return to the main menu.
Prompts the user for input in a visually distinct command line styled prompt (customized with ASCII color codes). This method captures the user’s menu choice for further processing.
The main method that initiates and maintains the command-line interface loop. It continuously displays the main menu and processes user choices. Depending on the selected option, it redirects to the appropriate submenu for training, testing, or reporting. The method terminates when the user selects the exit option.
The Console
class provides a clean, color-coded terminal interface where users interact through simple numeric inputs to navigate through various menus and execute tasks.
if __name__ == "__main__":
console = Console()
action = console.run()
print(f"Selected Action: {action}")
This class uses ANSI escape codes to provide color-coded text outputs:
-
Blue (
\033[1;34m
): Command prompt display. -
Green (
\033[1;32m
): Information display (project version and contact). -
Yellow (
\033[1;33m
): Menu titles and dividers. -
Cyan (
\033[1;36m
): Menu item numbers. -
White (
\033[0;37m
): Menu item descriptions.
The interface uses banners and color codes for a professional and clear command-line presentation, enhancing readability and user experience.
____ __ __ _
| _ \ | \/ | | |
| | | || |\/| | | |
| |_| || | | | | |___
|____/ |_| |_| |_____|
LLY-DML - Part of the LILY Project - Version 1.6 Beta - info@lilyqml.de - lilyqml.de
Choose an option:
1. Training - Train a new Model
2. Test - Test an existing Model
3. Create Report - Create a Report
4. Exit