Simple CUI input prompt
Project description
Simple CUI prompt input for Python
Installing
Install the latest stable from PyPi:
pip install prompter
Install the latest development version from master:
pip install git+git://github.com/tylerdave/prompter
Using
>>> from prompter import prompt, yesno
>>> prompt('What is your name?')
What is your name? Dave
'Dave'
>>> prompt('What is your name?', default='Jenn')
What is your name? [Jenn]
'Jenn'
>>> prompt('What is your name?', default='Jenn', suffix='\n > ')
What is your name? [Jenn]
>
'Jenn'
>>> prompt('Enter text surrounded by spaces.', strip=False)
Enter text surrounded by spaces. text
' text '
>>> yesno('Really?')
Really? [Y/n]
True
>>> yesno('Really?')
Really? [Y/n] no
False
>>> yesno('Really?', default='no')
Really? [y/N]
True
>>> yesno('')
[Y/n] n
False
Note
Please open an issue on Github if you notice problems or have suggestions!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prompter-0.3.8.tar.gz
(13.8 kB
view hashes)
Built Distributions
Close
Hashes for prompter-0.3.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cabbb5e2b91f6b4c2cdebe2f708b91553261522063e1e9334ff2ae9e9842b4d |
|
MD5 | e3e842df02700ef87fad69e8a0cd497a |
|
BLAKE2b-256 | 65501a735b6d507852657a49905bcf0fb0e443935015520671ded921cc9a41f8 |