Re: Storing lines from a text file

2006-01-29 Thread bradfordh
Whoops. I figured it out. Thanks for everybody's help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing lines from a text file

2006-01-29 Thread bradfordh
Alright now that I know how to read the text file line by line, my question is almost answered completely. And before I ask anything else I want to say thanks for the help recieved already. Well the last thing I need help on is storing each line into one big list. Each line needs to have its own p

Re: Storing lines from a text file

2006-01-29 Thread bradfordh
I keep getting an error when I try to use what you said Mr. McDonald. I think I've got something wrong, but take a look if you can. log = open('C:\log_0.txt') lines = log.getlines() for line in lines: print line When I debug it the error I get is the following: AttributeError: 'file'

Re: Storing lines from a text file

2006-01-29 Thread bradfordh
With what kind of list? I don't see how I can do it with a list unless I create one indefinate list and use the objects in the indefinate list for the names of the lists to hold the lines of text. Is that how you are suggesting that I do it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing lines from a text file

2006-01-29 Thread bradfordh
so this: a, b, c, d, e =f.readlines() ..this will put the first line in a, second in b, etc? How do I accomplish this when I'm not sure how many lines there are going to be every time? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Storing lines from a text file

2006-01-29 Thread bradfordh
Hello everyone. I am not sure how hard of a question is, but I do know that I need some help if you can give it. What I want to do is read the lines in a text file and store each line into a variable. I believe that I can use readlines() to read the individual lines, but how would I store each lin

Storing lines from a text file

2006-01-29 Thread bradfordh
Hello everyone. I am not sure how hard of a question is, but I do know that I need some help if you can give it. What I want to do is read the lines in a text file and store each line into a variable. I believe that I can use readlines() to read the individual lines, but how would I store each lin