matched = False
# assuming id is already set to the username and passwd to the password (both to be
# checked against the file listing)
for line in file('passwd.txt'):
user, pass = line.strip().split(':')
if (user == id) and (pass == passwd):
matched = True
break
if matched:
print "Success"
else:
print "Failure"

Last edited by Strike; June 8th, 2004 at 05:36 PM.
Reason: forgot to close code tag

matched = False
# assuming id is already set to the username and passwd to the password (both to be
# checked against the file listing)
for line in file('passwd.txt'):
user, pass = line.strip().split(':')
if (user == id) and (pass == passwd):
matched = True
break
if matched:
print "Success"
else:
print "Failure"