Skip to main content

A Handy Package to Create 3 Different types of Menus

Project description

0xMenu

A Handy Package to Create 3 Different types of Menus : ArrowKeyMenu will allow you to create interactive menus using the keyboard arrow key or vim j/k, NumberMenu will create simple menus where the user have to type the index, and finally CheckBox will allow you to create multiple choice menu

Installation :

From pip :

pip3 install oxmenu

From source :

git clone https://github.com/0x68616469/oxmenu/

Requirements :

oxansi (downloaded automatically with pip)

Example :

ArrowKeyMenu :

from oxmenu import ArrowKeyMenu
menu = ArrowKeyMenu(title="My Menu", subtitle="My Subtitle")

menu.add("One")
menu.add("Two")
menu.add("Three")
menu.add("Four")

selected = menu.select()

print(f"Selected : {selected}")

Result :

NumberMenu :

from oxmenu import NumberMenu
menu = NumberMenu(title="My Menu", subtitle="My Subtitle", input_message="Please choose an option : ")

menu.add("One")
menu.add("Two")
menu.add("Three")
menu.add("Four")

selected = menu.select()

print(f"Selected : {selected}")

Result :

CheckBox :

from oxmenu import CheckBox
menu = CheckBox(title="My Menu", subtitle="My Subtitle", min_options=1, max_options=2)

menu.add("One")  # You can add default=True
menu.add("Two")
menu.add("Three")
menu.add("Four")

selected = menu.select()

print(f"Selected : {selected}")

Result :


Follow me

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

oxmenu-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

oxmenu-0.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file oxmenu-0.0.3.tar.gz.

File metadata

  • Download URL: oxmenu-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for oxmenu-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ad2220a37b55bb131fc0168208f75b780684f27205d85460818a8a4ae05e42dd
MD5 a6522e04a4e73c520f804794ef394998
BLAKE2b-256 a3ecc397a2124c931250b7a65a8a32464ed34ef006921ef777ff6eac7248dd3c

See more details on using hashes here.

File details

Details for the file oxmenu-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: oxmenu-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for oxmenu-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 368ae27c4f5c0bb96559fe9daa80c5e2c5824deda8d8f9ca0a01603626ce3f35
MD5 67c1a6da862c928d783aebb9249723fb
BLAKE2b-256 546b4bcfb5d1c7b7566171a648877b82ec25ffb6b3cbbf9dbcf2c1c6e96f9eae

See more details on using hashes here.

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