Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys;
- fileContents = open('/home/yvemath/python/acc_db','r')
- err = 0
- print "...Enter a username"
- username = raw_input()
- print "...Enter the password"
- password = raw_input()
- acc_db = fileContents.read()
- up = acc_db.split('\n')
- eachword = up[0].split(" | ")
- for user in eachword:
- if user == username:
- userN = eachword.index(user)
- else:
- err = 1
- print userN
- eachword = up[1].split(" | ")
- for passw in eachword:
- if passw == password:
- passN = eachword.index(passw)
- else:
- err = 2
- print passN
- fileContents.close()
- sys.exit()
Add Comment
Please, Sign In to add comment