Creates a text-based menu in shell with python
- REGULAR
- BOLD
- ITALIC
- UNDERLINE
- BLINK
- INVERT
- BLACK
- RED
- GREEN
- YELLOW
- BLUE
- MAGENTA
- CYAN
- WHITE
- UNKNOWN
- DEFAULT
Example
setFont(Font.BOLD)
setColor(FgColor.RED)
setBgColor(BgColor.WHITE)
setTerm()
print("Hello World")Writes the given list to the screen in the form of a menu and returns the selected item
Parameters
| Params | Type | Description |
|---|---|---|
| title | str | The menu title that will be written to the screen |
| options | list [str] | The menu options that will be written to the screen |
| info | str | The digest information of menu that will be written to the screen afte menu title |
| multiple | bool | Multiple choices |
| selected | list [str] | To show the pre-selected ones |
Return
- if multi selection is enabled then return list
- else return selection value
showMenu(title, options, info, multiple=False, selected=[]):
options = ['Start', 'Settings', 'Exit']
showMenu('Tasks', options):Whenever you press the ':' key while the code is running, the command window becomes active and built-in commands can be executed. There is no case sensitive in command names
Built-in Commands
| Command | Description | Usage |
|---|---|---|
| set | set local variable | set var=2 |
| get | read local variable | get var |
