Skip to main content

A simple console menu

Project description

Simple console menu

This is a simple console menu

SimpleConsoleMenu


The first (and only) menu is the SimpleConsoleMenu.
You can use it by first importing the right file:

from simple_console_menu import Menu

And if you want to use it you can do this:

menu = Menu.SimpleConsoleMenu(menuName,menuItems,inputQuestion,autoAddQuit,onlyReturnNumber, allowedCharacters = '', acceptedQuitCharacters = '')

With these parameters :

menuName               - Required : name of the menu (Str)
menuItems              - Required : menu items, separated with ';' (Str)
inputQuestion          - Required : Question input (Str)
autoAddQuit            - Optional : automatically add a quit option (Bool)
onlyReturnNumber       - Optional : only numbers are allowed to return (Bool)
allowedCharacters      - Optional  : specifier which character(s) are allowed if onlyReturnNumber is False, separated with ';' (str)
acceptedQuitCharacters - Optional  : specifier which character is allowed if onlyReturnNumber is False for quit (str)

full example:

from simple_console_menu import Menu

menuNumber = Menu.SimpleConsoleMenu('menu','item1;item2;item3;item4;item5',True)

if menuNumber == 1:
    print('item1')
elif menuNumber == 2:
    print('item2')
elif menuNumber == 3:
    print('item3')
elif menuNumber == 4:
    print('item4')
elif menuNumber == 5:
    print('item5')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple-console-menu-0.0.7.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_console_menu-0.0.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file simple-console-menu-0.0.7.tar.gz.

File metadata

  • Download URL: simple-console-menu-0.0.7.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for simple-console-menu-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1885862020d6589c10c8b0cfe6b57a81dc68f0ba130aa1302ba717fae18adf66
MD5 f17df3212d2dcdfc24393e956a7cc654
BLAKE2b-256 8e6df371e68d1d05f7f0effe347ca2bcd199529232d4939ab56fc5143b82fbb9

See more details on using hashes here.

File details

Details for the file simple_console_menu-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_console_menu-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0e29f1779f73a58a0183f25f7b31d7ae951385f3438540a58d52a1e089817f84
MD5 a6d84da76ed5acf8d2de8273f1b646e9
BLAKE2b-256 f960c58864f2cb97f81fac9f6982547f20c4ca3f6040b6dee1419cc895300ea1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page