Skip to main content

Simple CUI input prompt

Project description

https://travis-ci.org/tylerdave/prompter.svg?branch=master

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='Dave')
What is your name?
[Dave] >
'Dave'

>>> 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('Really?', default='no')
Really? [y/N] y
False

>>> yesno('')
[Y/n] No
False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for prompter, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size prompter-0.3.2.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page