ask-0.0.8
توضیحات
Easy input validation for python
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | ask-0.0.8 |
| نام | ask |
| نسخه کتابخانه | 0.0.8 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Kim Thoenen |
| ایمیل نویسنده | kim@smuzey.ch |
| آدرس صفحه اصلی | https://github.com/chive/ask |
| آدرس اینترنتی | https://pypi.org/project/ask/ |
| مجوز | MIT |
ask
===
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)
نحوه نصب
نصب پکیج whl ask-0.0.8:
pip install ask-0.0.8.whl
نصب پکیج tar.gz ask-0.0.8:
pip install ask-0.0.8.tar.gz