Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import time
- currentTime = time.time()
- def writePassword(password):
- try:
- passwd = raw_input('Enter your password: ')
- file = 'pass.txt'
- if os.path.isfile(file):
- oFile = open(file, 'wr+')
- oFile.write(passwd)
- oFile.close
- except:
- print('Failed to write the password to the file.')
- def printPasswords(self, password):
- self.password = password
- print password
- def createPin(self, create_pin):
- self.create_pin = create_pin
- pinCreate = raw_input('Enter the pin you want: ')
- def login(self, pin):
- correctPin = None
- incorrectTimes = None
- self.pin = pin
- print('Default pin is {0}.').format(correctPin)
- enterPin = raw_input('Enter Pin: ')
- correctPin = 1000
- if enterPin.length>=4 or enterPin.length<=4:
- incorrectTimes = 0
- print('Invalid!')
- incorectTimes = incorectTimes + 1
- if incorrectTimes==4:
- print('Too many incorrect entries!\nYou must wait 1 minute')
- elif correctPin!=enterPin:
- print('Access Denied')
- elif int(correctPin)==int(enterPin):
- print('Access Granted.')
- enterPin = raw_input('Default Pin: 0000\nEnter Pin: ')
- pinCreate = raw_input('Create Pin: ')
- passwd = raw_input('')
- login(enterPin)
- createPin(pinCreate)
- writePassword(passwd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement