python-text-menu


Namepython-text-menu JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryBasic text menu for console
upload_time2024-04-01 03:06:10
maintainerNone
docs_urlNone
authorMacaya25 (Andres Macaya)
requires_pythonNone
licenseNone
keywords python menu cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Python text menu
Python module for interacting with the user through console, to install module from pip execute:
```bash
pip install python_text_menu
```

## Simple use
```python
from python_text_menu import print_menu

options = ['Option 1', 'Option 2', 'Option 3']
choice = print_menu(options)
```
Output:
```
Menu:
[1] Option 1
[2] Option 2
[3] Option 3
[4] Exit
Select an option: 
```

Then you can create your own flow based on 'choice':
```
if choice == '1':
    # Do something
elif choice == '2':
    # Do something else
...
```

## Customize

You can customize it by giving it a title, a separator and/or an input text:


```python
options = ['Option 1', 'Option 2', 'Option 3']
choice = print_menu(options, title='New title', sep=''*20, input_text='Choose something...')
```
Output:
```
New title:
====================
[1] Option 1
[2] Option 2
[3] Option 3
[4] Exit
Choose something...
```



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "python-text-menu",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, menu, cli",
    "author": "Macaya25 (Andres Macaya)",
    "author_email": "afmacaya@miuandes.cl",
    "download_url": "https://files.pythonhosted.org/packages/96/0c/fcb39a51c689e956c6784989b1d733ddab8b93272e9cf355a7afd1c825c6/python_text_menu-0.0.4.tar.gz",
    "platform": null,
    "description": "\n# Python text menu\nPython module for interacting with the user through console, to install module from pip execute:\n```bash\npip install python_text_menu\n```\n\n## Simple use\n```python\nfrom python_text_menu import print_menu\n\noptions = ['Option 1', 'Option 2', 'Option 3']\nchoice = print_menu(options)\n```\nOutput:\n```\nMenu:\n[1] Option 1\n[2] Option 2\n[3] Option 3\n[4] Exit\nSelect an option: \n```\n\nThen you can create your own flow based on 'choice':\n```\nif choice == '1':\n    # Do something\nelif choice == '2':\n    # Do something else\n...\n```\n\n## Customize\n\nYou can customize it by giving it a title, a separator and/or an input text:\n\n\n```python\noptions = ['Option 1', 'Option 2', 'Option 3']\nchoice = print_menu(options, title='New title', sep=''*20, input_text='Choose something...')\n```\nOutput:\n```\nNew title:\n====================\n[1] Option 1\n[2] Option 2\n[3] Option 3\n[4] Exit\nChoose something...\n```\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Basic text menu for console",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [
        "python",
        " menu",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfbd1beafa289592742d6384f03275d7bc0b278b003c25db904d24ce20c6adc2",
                "md5": "465f550f1334b3501ece4c4625e18f05",
                "sha256": "ee998767c810f3b6d8b98d3db0f44ab84e26bbd9574dd30804c980b2deb4e713"
            },
            "downloads": -1,
            "filename": "python_text_menu-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "465f550f1334b3501ece4c4625e18f05",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 2365,
            "upload_time": "2024-04-01T03:06:08",
            "upload_time_iso_8601": "2024-04-01T03:06:08.841969Z",
            "url": "https://files.pythonhosted.org/packages/cf/bd/1beafa289592742d6384f03275d7bc0b278b003c25db904d24ce20c6adc2/python_text_menu-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "960cfcb39a51c689e956c6784989b1d733ddab8b93272e9cf355a7afd1c825c6",
                "md5": "a223750f926fc9fc065d46689818ebc5",
                "sha256": "a54ce9a83a0785943d734cb402d7c77923a5af583a1bead78bac40e853a38da5"
            },
            "downloads": -1,
            "filename": "python_text_menu-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a223750f926fc9fc065d46689818ebc5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2047,
            "upload_time": "2024-04-01T03:06:10",
            "upload_time_iso_8601": "2024-04-01T03:06:10.455462Z",
            "url": "https://files.pythonhosted.org/packages/96/0c/fcb39a51c689e956c6784989b1d733ddab8b93272e9cf355a7afd1c825c6/python_text_menu-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 03:06:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-text-menu"
}
        
Elapsed time: 0.62800s