#!/usr/bin/env python
import random
passwd = None
while True :
line = raw_input ( '> ' ) .rstrip ( '\r \n ' )
# Handle: pass
if line.lower ( ) == 'pass' :
print 'Password: {}' .format ( passwd)
# For Python <=2.5.6:
#print 'Password: %s' % passwd
# Handle: randompass
elif line.lower ( ) == 'randompass' :
passwd = random .randint ( 10000000 , 99999999 )
print 'Password generated and stored. Use \' pass\' to retrieve.'
# Handle: exit
elif line.lower ( ) == 'exit' :
print 'Exiting.'
break
IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgppbXBvcnQgcmFuZG9tCgpwYXNzd2QgPSBOb25lCgp3aGlsZSBUcnVlOgogICAgbGluZSA9IHJhd19pbnB1dCgnPiAnKS5yc3RyaXAoJ1xyXG4nKQogICAgCiAgICAjIEhhbmRsZTogcGFzcwogICAgaWYgbGluZS5sb3dlcigpID09ICdwYXNzJzoKICAgICAgICBwcmludCAnUGFzc3dvcmQ6IHt9Jy5mb3JtYXQocGFzc3dkKQogICAgICAgICMgRm9yIFB5dGhvbiA8PTIuNS42OgogICAgICAgICNwcmludCAnUGFzc3dvcmQ6ICVzJyAlIHBhc3N3ZAogICAgIyBIYW5kbGU6IHJhbmRvbXBhc3MKICAgIGVsaWYgbGluZS5sb3dlcigpID09ICdyYW5kb21wYXNzJzoKICAgICAgICBwYXNzd2QgPSByYW5kb20ucmFuZGludCgxMDAwMDAwMCwgOTk5OTk5OTkpCiAgICAgICAgcHJpbnQgJ1Bhc3N3b3JkIGdlbmVyYXRlZCBhbmQgc3RvcmVkLiBVc2UgXCdwYXNzXCcgdG8gcmV0cmlldmUuJwogICAgIyBIYW5kbGU6IGV4aXQKICAgIGVsaWYgbGluZS5sb3dlcigpID09ICdleGl0JzoKICAgICAgICBwcmludCAnRXhpdGluZy4nCiAgICAgICAgYnJlYWs=