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.10.tar.gz
(19.1 kB
view details)
Built Distribution
File details
Details for the file prompter-0.3.10.tar.gz
.
File metadata
- Download URL: prompter-0.3.10.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ac65696ec1ece934bd8b36cb901d36104c2be7f376cb52c695a6119d35ea9f |
|
MD5 | 8affe6ee0032f8362dc2803f806cf7f4 |
|
BLAKE2b-256 | 8bf8a2c891352ff2f5394818cb84fd9e506a0172ab8c086c4fed2a78fe7fc777 |
File details
Details for the file prompter-0.3.10-py2.py3-none-any.whl
.
File metadata
- Download URL: prompter-0.3.10-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cf1ae84255381247de1b9474e0725b2ad7ad5905954b3936c20fa03a84982b1 |
|
MD5 | 55e686256dea97765b18bad365d828b6 |
|
BLAKE2b-256 | 4dc3575cc491b9d0df2c56a64d37a04adcd64de7912fdfd758ad5f542c82e73c |