Skip to main content

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

Project description

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

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

gb-menu-1.0.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

gb_menu-1.0.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page