File: many-choices.py

package info (click to toggle)
prompt-toolkit 3.0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,628 kB
  • sloc: python: 31,599; makefile: 151; sh: 6
file content (15 lines) | stat: -rw-r--r-- 292 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from __future__ import annotations

from prompt_toolkit.shortcuts import choice


def main() -> None:
    result = choice(
        message="Please select an option:",
        options=[(i, f"Option {i}") for i in range(1, 100)],
    )
    print(result)


if __name__ == "__main__":
    main()