dumb-menu


Namedumb-menu JSON
Version 1.0.8 PyPI version JSON
download
home_page
SummaryA light weight command line menu that supports Windows, MacOS, and Linux
upload_time2023-07-14 06:59:27
maintainer
docs_urlNone
authorclever chen
requires_python
license
keywords python menu dumb_menu windows mac linux
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# dumb_menu



[![Downloads](https://static.pepy.tech/badge/dumb-menu)](https://pepy.tech/project/dumb-menu)



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 dumb-menu

```



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



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



## Usage



example:



```python

import dumb_menu

options = ["[1]Option 1", "[2]Option 2", "[3]Option 3","[q]quit"]

index = dumb_menu.get_menu_choice(options)

print(f"You selected option {index + 1}: {options[index]}")

```





![png](https://raw.githubusercontent.com/cornradio/imgs/main/20230214163952.png)



another example:



```python

import os

import dumb_menu



def loopmenu():

    options = ["[1]happy",

            "[2]sad",

            "[3]give me a cookie",

            "[q]quit"]

    index = dumb_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](https://i.imgur.com/7zjLt8g.png)





## Get help



Get help ➡️ [Github issue](https://github.com/cornradio/dumb_menu/issues)



## Update log





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



```python

dumb_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()

```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dumb-menu",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,menu,dumb_menu,windows,mac,linux",
    "author": "clever chen",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4f/0e/a53eaadd908c44c7e4f51ca972f90b74ea1aaead3d940c3458a192247b44/dumb_menu-1.0.8.tar.gz",
    "platform": null,
    "description": "\r\n# dumb_menu\r\r\n\r\r\n[![Downloads](https://static.pepy.tech/badge/dumb-menu)](https://pepy.tech/project/dumb-menu)\r\r\n\r\r\nsimple_term_menu don't support windows, so I made dumb_menu.\r\r\n\r\r\ndumb_menu is not as powerful as simple_term_menu , but this a **GOOD OLD MENU** .\r\r\n\r\r\ndumb_menu is a light weight command line menu that supports **Windows**, **MacOS**, and **Linux**.\r\r\n\r\r\n\r\r\n## Installation\r\r\n\r\r\n```\r\r\npip install dumb-menu\r\r\n```\r\r\n\r\r\nhttps://pypi.org/project/dumb-menu/\r\r\n\r\r\nhttps://github.com/cornradio/dumb_menu (I want stars \u2b50 uwu)\r\r\n\r\r\n## Usage\r\r\n\r\r\nexample:\r\r\n\r\r\n```python\r\r\nimport dumb_menu\r\r\noptions = [\"[1]Option 1\", \"[2]Option 2\", \"[3]Option 3\",\"[q]quit\"]\r\r\nindex = dumb_menu.get_menu_choice(options)\r\r\nprint(f\"You selected option {index + 1}: {options[index]}\")\r\r\n```\r\r\n\r\r\n\r\r\n![png](https://raw.githubusercontent.com/cornradio/imgs/main/20230214163952.png)\r\r\n\r\r\nanother example:\r\r\n\r\r\n```python\r\r\nimport os\r\r\nimport dumb_menu\r\r\n\r\r\ndef loopmenu():\r\r\n    options = [\"[1]happy\",\r\r\n            \"[2]sad\",\r\r\n            \"[3]give me a cookie\",\r\r\n            \"[q]quit\"]\r\r\n    index = dumb_menu.get_menu_choice(options,isclean = True)\r\r\n    # clear screen, cls for windows, clear for linux\r\r\n    os.system('cls') \r\r\n    # Python 3.10+ only,old version could use if-else\r\r\n    match index:\r\r\n        case 0:\r\r\n            print(\":)\")\r\r\n        case 1:\r\r\n            print(\":(\")\r\r\n        case 2:\r\r\n            print(\"\ud83c\udf6a\u30fe(\u2022\u03c9\u2022`)o\")\r\r\n        case 3:\r\r\n            exit()\r\r\n    input('Press ENTER to continue...')\r\r\n\r\r\nif __name__ == \"__main__\":\r\r\n    while True:\r\r\n        loopmenu()\r\r\n```\r\r\n![Imgur](https://i.imgur.com/7zjLt8g.png)\r\r\n\r\r\n\r\r\n## Get help\r\r\n\r\r\nGet help \u27a1\ufe0f [Github issue](https://github.com/cornradio/dumb_menu/issues)\r\r\n\r\r\n## Update log\r\r\n\r\r\n\r\r\n`1.0.8` add \"return key string\" option , add `demo.py`  As a straightforward example\r\r\n\r\r\n```python\r\r\ndumb_menu.get_menu_choice(options,give_key_str = True)\r\r\n```\r\r\n\r\r\n`1.0.7` fix \"flickering on mac zsh\" \r\r\n\r\r\n`1.0.6` forget write log in 1.0.5\r\r\n\r\r\n`1.0.5` fix bug in 1.0.4\r\r\n\r\r\n`1.0.4` support \"clean mode\" \r\r\n\r\r\n`1.0.3` show selected index also when using hotkey  \r\r\n\r\r\n`1.0.2` first useable version\r\r\n\r\r\n`1.0.1` fix bug\r\r\n\r\r\n`1.0.0` first release\r\r\n\r\r\n## how to upload a new version (for me)\r\r\n\r\r\nen: https://packaging.python.org/tutorials/packaging-projects/ \r\r\n\r\r\nzh: https://python-packaging-zh.readthedocs.io/zh_CN/latest/minimal.html#id2\r\r\n\r\r\n> make sure have twine installed first\r\r\n\r\r\n1. change `setup.py`\r\r\n2. testing `python3 setup.py develop`\r\r\n3. `python3 setup.py sdist`\r\r\n4. `twine upload dist/*`\r\r\n\r\r\ntest code :\r\r\n```\r\r\npython3\r\r\n\r\r\nimport dumb_menu\r\r\ndumb_menu.demo()\r\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A light weight command line menu that supports Windows, MacOS, and Linux",
    "version": "1.0.8",
    "project_urls": null,
    "split_keywords": [
        "python",
        "menu",
        "dumb_menu",
        "windows",
        "mac",
        "linux"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f0ea53eaadd908c44c7e4f51ca972f90b74ea1aaead3d940c3458a192247b44",
                "md5": "b382cf9a28af2d90866e77f6f08d53db",
                "sha256": "542b0a9efb433e235bf7f74785c1857883f2d79fceb71a3d139cb8f11cee2fde"
            },
            "downloads": -1,
            "filename": "dumb_menu-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "b382cf9a28af2d90866e77f6f08d53db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4158,
            "upload_time": "2023-07-14T06:59:27",
            "upload_time_iso_8601": "2023-07-14T06:59:27.725601Z",
            "url": "https://files.pythonhosted.org/packages/4f/0e/a53eaadd908c44c7e4f51ca972f90b74ea1aaead3d940c3458a192247b44/dumb_menu-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-14 06:59:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dumb-menu"
}
        
Elapsed time: 0.10741s