File: number.py

package info (click to toggle)
python-inquirerpy 0.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,088 kB
  • sloc: python: 9,463; makefile: 15
file content (20 lines) | stat: -rw-r--r-- 469 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from InquirerPy import inquirer
from InquirerPy.validator import EmptyInputValidator


def main() -> None:
    integer_val = inquirer.number(
        message="Enter integer:",
        min_allowed=-2,
        max_allowed=10,
        validate=EmptyInputValidator(),
    ).execute()
    float_val = inquirer.number(
        message="Enter float:",
        float_allowed=True,
        validate=EmptyInputValidator(),
    ).execute()


if __name__ == "__main__":
    main()