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,autoAddQuit,onlyReturnNumber, allowedCharacters = '')

With these parameters :

menuName           - Required : name of the menu (Str)
menuItems          - Required : menu items, separated with ';' (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)

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.5.tar.gz (3.1 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.5-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple-console-menu-0.0.5.tar.gz
  • Upload date:
  • Size: 3.1 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.5.tar.gz
Algorithm Hash digest
SHA256 3800ca83fdc7761967b0995b6eefc2cd2a59c647f62e18be6e3443fb6d01a496
MD5 17a2d381693b8c628dc3aea83808c926
BLAKE2b-256 4c81e5b44e08a0ffa2940efd5327807a3c8ea0bbd8835c57af4844053bd0bce1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_console_menu-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f4d15c0e728171407b761e056576036d8f339aa0eaefcb221c5c8fd94be9bb7a
MD5 2249e10701868bc4da0805288de07b70
BLAKE2b-256 5073390c9ec670ddccc7831172c5757f2446ba958e834f8aeae9a66bc401beaf

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