Advertisement
ItzStaze

Untitled

Dec 20th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. import os
  2. import sys
  3. import time
  4.  
  5. currentTime = time.time()
  6.  
  7. def writePassword(password):
  8.     try:
  9.         passwd = raw_input('Enter your password: ')
  10.         file = 'pass.txt'
  11.         if os.path.isfile(file):
  12.             oFile = open(file, 'wr+')
  13.             oFile.write(passwd)
  14.             oFile.close
  15.     except:
  16.         print('Failed to write the password to the file.')
  17. def printPasswords(self, password):
  18.     self.password = password
  19.     print password
  20. def createPin(self, create_pin):
  21.     self.create_pin = create_pin
  22.     pinCreate = raw_input('Enter the pin you want: ')
  23. def login(self, pin):
  24.     correctPin = None
  25.     incorrectTimes = None
  26.     self.pin = pin
  27.     print('Default pin is {0}.').format(correctPin)
  28.     enterPin = raw_input('Enter Pin: ')
  29.     correctPin = 1000
  30.     if enterPin.length>=4 or enterPin.length<=4:
  31.         incorrectTimes = 0
  32.         print('Invalid!')
  33.         incorectTimes = incorectTimes + 1
  34.         if incorrectTimes==4:
  35.             print('Too many incorrect entries!\nYou must wait 1 minute')
  36.     elif correctPin!=enterPin:
  37.         print('Access Denied')
  38.     elif int(correctPin)==int(enterPin):
  39.         print('Access Granted.')
  40. enterPin = raw_input('Default Pin: 0000\nEnter Pin: ')
  41. pinCreate = raw_input('Create Pin: ')
  42. passwd = raw_input('')
  43. login(enterPin)
  44. createPin(pinCreate)
  45. writePassword(passwd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement