Requires
Curses, on Linux pre-installed, on windows you need windows-curses, so you can install it with pip install windows-curses
Or just add to your code:
import ezztui
ezztui.check_curses() # not needed if you are using ezztui 2.0.0 or later, it will check for curses automatically
Use
Up-Down Arrow Keys: Move cursor
Enter: Choose current option
Backspace: Go back
Coding
Print text on center of console
import ezztui
ezztui.center_message("Hello World!") # prints "Hello World!" on the center of the console
ezztui.center_multiline(["Hello", "multiline", "world!"]) # prints "Hello" on the center of the console, then "multiline" on the next line, then "world!" on the next line
Clear console
import ezztui
ezztui.cls() # clears the console with a os.system command
ezztui.softcls() # clears the console with a multiple newline
Menu
Usage
import ezztui
menu = {
'First menu':
{'Function 1': 'ezztui_return_value', # use 'return' also from 2.0.0
'Function 2': 'ezztui_return_value', # specify a function to be called from 4.0.0
'Function 3': 'ezztui_return_value',
'Function 4': 'ezztui_return_value',
'Function 5': 'ezztui_return_value',
'Back': 'ezztui_back_value'}, # use 'back' also from 2.0.0
'Second menu':
{'Submenu 1': {
'Function 1': 'ezztui_return_value',
'Function 2': 'ezztui_return_value',
'Function 3': 'ezztui_return_value',
'Function 4': 'ezztui_return_value',
'Function 5': 'ezztui_return_value',
'Back': 'ezztui_back_value'},
'Submenu 2': {
'Function 1': 'ezztui_return_value',
'Function 2': 'ezztui_return_value',
'Function 3': 'ezztui_return_value',
'Function 4': 'ezztui_return_value',
'Back': 'ezztui_back_value'},
'Submenu 3': {
'Function 1': 'ezztui_return_value',
'Function 2': 'ezztui_return_value',
'Function 3': 'ezztui_return_value',
'Back': 'ezztui_back_value'},
'Submenu 4': {
'Function 1': 'ezztui_return_value',
'Function 2': 'ezztui_return_value',
'Back': 'ezztui_back_value'},
'Back': 'ezztui_back_value'},
'No submenu function': 'ezztui_return_value',
'Third menu':
{'Function 1': 'ezztui_return_value',
'Function 2': 'ezztui_return_value',
'Function 3': 'ezztui_return_value',
'Function 4': 'ezztui_return_value',
'Back': 'ezztui_back_value'},
'Exit':
{"Exit": 'ezztui_exit_value',
"Back": 'ezztui_back_value'} # use 'exit' also from 2.0.0
}
print(ezztui.menu(menu)) # prints the menu and returns name of function and path to it in menu,
# You can process this value in your program or add while True (or something else)
Returns
['Second menu', 'Submenu 2', 'Function 3']
Metadata
Release files for ezztui 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ezztui-4.0.0.tar.gz | 3.7 kB | Without provenance | Details |
Release files / ezztui-4.0.0.tar.gz
| Download URL | ezztui-4.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
436239878ec5158be73dcdc7cf6ea5608151ccb6bebfe61809c6eac89ca18bd8
|
|
BLAKE2b-256 checksum How to use checksums |
3170e2020951cc3d10b6c68dbbb21f91035103fe14538842ed958135afe0a437
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for ezztui 4.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.