serie_classic.py 430 B

12345678910111213141516171819202122232425262728
  1. from PyInquirer import prompt
  2. def isAuthorized(dico):
  3. return dico["one"] == 'Dricom'
  4. widget = [
  5. {
  6. 'type':'input',
  7. 'name':'one',
  8. 'message':'First name'
  9. },
  10. {
  11. 'type':'password',
  12. 'name':'three',
  13. 'message':'Your non secured password',
  14. 'when':lambda answers : isAuthorized(answers)
  15. },
  16. {
  17. 'type':'input',
  18. 'name':'two',
  19. 'message':'Last name'
  20. }
  21. ]
  22. result = prompt(widget)
  23. print('Your answer is')
  24. print(result)