A lightweight Python library useful for creating powerful yet simple console-based user interfaces
Project description
Welcome to gb-menu 👋
A lightweight Python library useful for creating powerful yet simple console-based user interfaces
Install
pip install gb-menu
Usage
from gb_menu import menu, choice, action
main_menu = menu.Menu()
cont_action = action.Action(function=type(None))
cont_choice = choice.Choice(key='c', text='Continue', action=cont_action)
main_menu.add_choice(cont_choice)
quit_action = action.Action(function=exit)
quit_choice = choice.Choice(key='q', text='Quit', action=quit_action)
main_menu.add_choice(quit_choice)
while True:
main_menu.show()
Output
c: Continue
q: Quit
Choice: c
c: Continue
q: Quit
Choice: c
c: Continue
q: Quit
Choice: q
Process finished with exit code 0
Author
👤 Garrett Beard
- Github: @gbeard2
- LinkedIn: @garrett-beard
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2021 Garrett Beard.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator
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
gb-menu-1.0.0.tar.gz
(3.0 kB
view hashes)