help

Ben Drayton tkablackdeath at hotmail.com
Mon Mar 8 01:32:06 EST 2004


hey i was wondering if there was any easy was to make txt documents end 
lines. I have a very basic password program which needs to pick a line out 
from the others in the document to use as the password. However the document 
is just comming out in one long line. Also any sugestions for imporement on 
my password program would be appreciated. thnaks. (here is the program if it 
helps. it sucks i kno but hey im new)

count = 0
password = ""
password1 = ""
username = ""
username1 = ""
pword = open ('hddl.txt')
while password1 != pword.readline (26) and username1 != pword.readline (4)  
and password != pword.readline(28)  and username != pword.readline(5) and 
count < 3:
    username = raw_input("username:")
    password = raw_input("password:")
    count = count +1
    if username == pword.readline(4) and password == pword.readline (26):
        password = password1
        username = username1
        password = pword.readline(28)
        username = pword.readline(5)
    if username == pword.readline(5) and password == pword.readline(28):
        password1 = pword.readline (26)
        username1 = pword.readline (4)
    else:
        print
if (password1 == pword.readline(26) and username1 == pword.readline(4) and 
count < 3 and password == pword.readline(28)  and username == 
pword.readline(5) and count < 3):
#there is a program here
else:
     print "sorry authorised access onl"

_________________________________________________________________
Surf the net and talk on the phone with Xtra JetStream @  
http://xtra.co.nz/jetstream





More information about the Python-list mailing list