File: async.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 (19 lines) | stat: -rw-r--r-- 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import asyncio

from InquirerPy import inquirer, prompt_async


async def main():
    questions = [
        {"type": "input", "message": "Name:"},
        {"type": "number", "message": "Number:"},
        {"type": "confirm", "message": "Confirm?"},
    ]
    result = await prompt_async(questions)
    name = await inquirer.text(message="Name:").execute_async()
    number = await inquirer.number(message="Number:").execute_async()
    confirm = await inquirer.confirm(message="Confirm?").execute_async()


if __name__ == "__main__":
    asyncio.run(main())