Skip to main content

A short description of your package

Project description

dumb_menu

Downloads

simple_term_menu don't support windows, so I made dumb_menu.

dumb_menu is not as powerful as simple_term_menu , but this a GOOD OLD MENU .

dumb_menu is a light weight command line menu that supports Windows, MacOS, and Linux.

Installation

pip install lw-menu

https://pypi.org/project/dumb-menu/

https://github.com/cornradio/dumb_menu (I want stars ⭐ uwu)

Usage

example:

import lw_menu
options = ["[1]Option 1", "[2]Option 2", "[3]Option 3","[q]quit"]
index = lw_menu.get_menu_choice(options)
print(f"You selected option {index + 1}: {options[index]}")

png

another example:

import os
import lw_menu

def loopmenu():
    options = ["[1]happy",
            "[2]sad",
            "[3]give me a cookie",
            "[q]quit"]
    index = lw_menu.get_menu_choice(options,isclean = True)
    # clear screen, cls for windows, clear for linux
    os.system('cls') 
    # Python 3.10+ only,old version could use if-else
    match index:
        case 0:
            print(":)")
        case 1:
            print(":(")
        case 2:
            print("🍪ヾ(•ω•`)o")
        case 3:
            exit()
    input('Press ENTER to continue...')

if __name__ == "__main__":
    while True:
        loopmenu()

Imgur

Get help

Get help ➡️ Github issue

Update log

1.0.8 add "return key string" option , add demo.py As a straightforward example

lw_menu.get_menu_choice(options,give_key_str = True)

1.0.7 fix "flickering on mac zsh"

1.0.6 forget write log in 1.0.5

1.0.5 fix bug in 1.0.4

1.0.4 support "clean mode"

1.0.3 show selected index also when using hotkey

1.0.2 first useable version

1.0.1 fix bug

1.0.0 first release

how to upload a new version (for me)

en: https://packaging.python.org/tutorials/packaging-projects/

zh: https://python-packaging-zh.readthedocs.io/zh_CN/latest/minimal.html#id2

make sure have twine installed first

  1. change setup.py
  2. testing python3 setup.py develop
  3. python3 setup.py sdist
  4. twine upload dist/*

test code :

python3

import dumb_menu
dumb_menu.demo()

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

lw_menu-1.0.5.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

lw_menu-1.0.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file lw_menu-1.0.5.tar.gz.

File metadata

  • Download URL: lw_menu-1.0.5.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for lw_menu-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d57f1927f924faa6c338fe7722e99aaf9f68b2fe2b0c3a1e2b1e4b9b82925fcb
MD5 ad8af9192588d45e9a1df603a32c02d8
BLAKE2b-256 1aff218bc232d3e656f3c0b257dbf08adf204a7dda31052410dc5faf682e152f

See more details on using hashes here.

File details

Details for the file lw_menu-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: lw_menu-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for lw_menu-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 56c316c7720bb5de6c646be9f3a5560555c90cceb3ecc0033952e0f0651d3ff0
MD5 9bd9ecf21ca4ad218486b96379df5c50
BLAKE2b-256 17260a0e6e716097c8aa10fa031deee172ae39bda11868816ef35cdc3abddaf1

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