A lightweight Python library useful for creating powerful yet simple console-based user interfaces
pip install gb-menu
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()
c: Continue
q: Quit
Choice: c
c: Continue
q: Quit
Choice: c
c: Continue
q: Quit
Choice: q
Process finished with exit code 0
👤 Garrett Beard
- Github: @gbeard2
- LinkedIn: @garrett-beard
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2021 Garrett Beard.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator