for the lolz
项目描述
Python的简单输入验证
安装
pip install ask
用法
>>> 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)
项目详情
关闭
melebeats-0.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0c7d09ca7846fd8d9979fb3f19cec8a03d1bdb9c851cb8bb7cc8c534a7beaaaa |
|
MD5 | efa8b7aca4d8f91cc1e6ad90d996ec0b |
|
BLAKE2b-256 | 9f7e6cabb34de3759bb26527346a705a70dba9106aa1407dd81804d4255e6dd1 |