12345678910111213141516171819202122232425262728 |
- from PyInquirer import prompt
- def isAuthorized(dico):
- return dico["one"] == 'Dricom'
- widget = [
- {
- 'type':'input',
- 'name':'one',
- 'message':'First name'
- },
- {
- 'type':'password',
- 'name':'three',
- 'message':'Your non secured password',
- 'when':lambda answers : isAuthorized(answers)
- },
- {
- 'type':'input',
- 'name':'two',
- 'message':'Last name'
- }
- ]
- result = prompt(widget)
- print('Your answer is')
- print(result)
|