The easy way to create command line menus
Project description
Install
$ pip install pyclimenu
Demo
>>> from pyclimenu import Menu
>>> def first_function(a=0):
... print(a*2)
...
>>> def second_function(a=0):
... print(a*4)
...
>>> mn = Menu()
>>> mn.add_item(label='first function', callback=first_function, params={'a': 2})
>>> mn.add_item(label='second function', callback=second_function, params={'a': 1})
>>> mn.display()
[0] first function
[1] second function
[2] Exit
Select option: > 1
4
>>>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyclimenu-0.1.4.tar.gz
(2.8 kB
view hashes)