ExamplesΒΆ
- Ask for a floating point number:
>>> prompt.real() ? 0.02 0.02
- The prompt may be customized:
>>> prompt.integer(prompt="[0-9]+ ") [0-9]+ 42 42
- You can allow empty responses:
>>> prompt.string(empty=True) ? <Enter> None
- Ask for a password:
>>> promp.secret(prompt="Enter your password: ") Enter your password: '$uper$ecretP@ssw0rd'
- Invalid responses will be rejected:
>>> prompt.email() ? Bob.Miller ? bob@miller.foo 'bob@miller.foo'