Back to Python

See also PyInvokeclick

Awesome Command Line Tools

1. Python Prompt Toolkit

https://github.com/prompt-toolkit/python-prompt-toolkit

https://python-prompt-toolkit.readthedocs.io/

1.1. Installation

pip install prompt_toolkit

1.2. Auto Completion

from prompt_toolkit.completion import WordCompleter
from prompt_toolkit import prompt

serviceCompleter = WordCompleter(['service:1mm', 'service:fracture'], ignore_case=True) # read service list
user_input = prompt(f' > GPU 0:', completer=serviceCompleter,)
print(f"gpu0={user_input}")

2. Reference

MainWiki: python_command_line_tools (last edited 2020-03-30 23:33:01 by twotwo)