confirm.py 259 B

1234567891011121314151617
  1. from PyInquirer import prompt
  2. widget = [
  3. {
  4. 'type':'confirm',
  5. 'name':'ok',
  6. 'message':'Would you like to know the ultimate answer ?',
  7. 'default':True
  8. }
  9. ]
  10. result = prompt(widget)
  11. print('Your answer is')
  12. print(result["ok"])
  13. if result["ok"]:
  14. print(42)