Skip to content

A lightweight Python library useful for creating powerful yet simple console-based user interfaces

License

Notifications You must be signed in to change notification settings

gbeard2/gb-menu

Repository files navigation

Welcome to gb-menu 👋

Python Versions Release Downloads Weekly Commits

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

🤝 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

About

A lightweight Python library useful for creating powerful yet simple console-based user interfaces

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages