Beginners help with password program!
tjland at iserv.net
tjland at iserv.net
Sat Jul 26 18:08:39 EDT 2003
This is my first version of this program, im kinda new to python and i was
wondering if someone could help me with this. Their are some errors that i
just cant find, and i want some advice on how to do some of these things
easier. Thanx for the help!
----------------------------------------------------------------------------
from time import sleep
def Sendfile(password, username):
outfile = file(username, "w")
outfile.write(password)
outfile.close()
print "Your are now registered"
def Getfile(username):
infile = file(username, "r")
content = infile.readline(1)
global content
infile.close()
login = input("Are u registered? ")
if login == no:
new_username = input("What do you want for a username, please letters
only: ")
new_password = input("What do you wish for a password: ")
Sendfile(new_password, new_username)
else:
print "Please Login, Enter username, then wait for prompt!"
username = input("Username: ")
sleep(5)
password = input("Password: ")
Getfile(username)
if password != content:
print """Im sorry but you are not a registered user,
If you would like to become a user contact the server admin for
user privelges"""
else:
print "Welcome"
----------------------------------------------------------------------------
When you see the net take the shot
When you miss your shot shoot again
When you make your shot you win!
Just remember
Offense sells tickets
But defense wins championships!
More information about the Python-list
mailing list