Skip to main content

Easy input validation for python

Installation

pip install ask

Usage

>>> from ask import ask, askChar, askInt, askString, askPassword, askEmail, askBool, explain
>>> ask()
# Creates an empty input query here

>>> askInt('Your age')
Your age
# Input here (Only accepts integers)

>>> askString("What's your name?")
What's your name?
# Input here

>>> askChar('Do you want to proceed?', ['y','n'])
Do you want to proceed? (y/n)
# Input here (Only accepts 'y' and 'n')

>>> askChar('Do you want to install this?', ['y','n'], 'y')
Do you want to install this? (y/n) [y]
# Input here (Only accepts 'y' and 'n', you can hit enter to use the default 'y')

>>> askBool('Do you want to continue?')
Do you want to continue (y/n)
# Input here (automatically generates the possibilites 'y' and 'n')

>>> askEmail()
# Input here (only accepts email-adresses)

>> askPassword()
# Masked input here

>> explain()
# Prints explanation:
Attention: Input prompts follow this template:
"Question (answer1, answer2, answer3) [default_answer]"
(You can just hit enter to chose the default answer)

Download files

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

Source Distribution

melebeats-0.1.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file melebeats-0.1.tar.gz.

File metadata

  • Download URL: melebeats-0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for melebeats-0.1.tar.gz
Algorithm Hash digest
SHA256 223b762032a80f9ed4f6d0c75f193f4797548cf45fabc85ffc97b11f4594ecf1
MD5 c27a365dfc0f2254a0b13529aef5dd72
BLAKE2b-256 e799f7786c0dc2074332543fd132db1c5c925f09ae5150ff2dea7068d4673a49

See more details on using hashes here.

Supported by

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