login2
This program dates back to 2004 or 2005. It is an attempt at a user-account system using raw_input as a command-line.
while 1: name = raw_input('Enter Username:') myfile = open("uname", 'r') oldun = myfile.readline() if name == 'stop': break if name == ' ': break if name == 'new user': cnu = raw_input('Create New User? :') if cnu == 'yes': print 'good' pw = raw_input('Enter UserName :') myfile = open('oldun', 'w') oldpw = myfile.readline() if pw == oldpw: print 'Hello' pw = raw_input('Enter Password :') myfile = open('passwords', 'w') oldpw = myfile.readline() if pw == oldpw: print 'Hello' if name == oldun: pw = raw_input('Enter Password :') myfile = open('passwords', 'r') oldpw = myfile.readline() if pw == oldpw: print 'Hello' if pw == 'cp': cp = raw_input('Change Password? ') if cp == 'yes': uname = raw_input('Enter Username:') if uname == name: nnp = raw_input('Type new Password ') pw = raw_input('Retype To Confirm :') if pw == nnp: print 'Hello', name myfile = open('username', 'w') myfile.write(nnp) myfile.close() myfile = open(uname,'2', 'w') myfile.write(uname) myfile.close()