ask pypi

Solutions on MaxInterview for ask pypi by the best coders in the world

showing results for - "ask pypi"
Yohan
19 Feb 2017
1>>> from ask import ask, askChar, askInt, askString, askPassword, askEmail, askBool, explain
2>>> ask()
3# Creates an empty input query here
4
5>>> askInt('Your age')
6Your age
7# Input here (Only accepts integers)
8
9>>> askString("What's your name?")
10What's your name?
11# Input here
12
13>>> askChar('Do you want to proceed?', ['y','n'])
14Do you want to proceed? (y/n)
15# Input here (Only accepts 'y' and 'n')
16
17>>> askChar('Do you want to install this?', ['y','n'], 'y')
18Do you want to install this? (y/n) [y]
19# Input here (Only accepts 'y' and 'n', you can hit enter to use the default 'y')
20
21>>> askBool('Do you want to continue?')
22Do you want to continue (y/n)
23# Input here (automatically generates the possibilites 'y' and 'n')
24
25>>> askEmail()
26# Input here (only accepts email-adresses)
27
28>> askPassword()
29# Masked input here
30
31>> explain()
32# Prints explanation:
33Attention: Input prompts follow this template:
34"Question (answer1, answer2, answer3) [default_answer]"
35(You can just hit enter to chose the default answer)
36
queries leading to this page
ask ubuntuask pypi