Skip to main content

Simple CUI input prompt

Project description

https://travis-ci.org/tylerdave/prompter.svg?branch=master http://badge.fury.io/py/prompter.png

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


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.6.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file prompter-0.3.6.tar.gz.

File metadata

  • Download URL: prompter-0.3.6.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for prompter-0.3.6.tar.gz
Algorithm Hash digest
SHA256 2321e0508a1c4f452d17d3bc68722082529ad4323e31908559915787778f8f76
MD5 bde01f59b59bb5b0da25ddb522b63e2e
BLAKE2b-256 84c57ff20b31c7be7ba537cd8e76b8a97b16c17e3d96cd66ff4d6ee1cb862c65

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page