readln() until EOF

korean_dave davidreynon at gmail.com
Thu Jul 24 15:09:00 EDT 2008


a = open("Thefile.txt","r")

while ?????:
  result = a.readln()

what do i put in ???? if i want to keep reading line by line until i
reach the end of the file?

I don't want to break the loop if there is a blank line, because there
will be.

Ex. of a file:

map1
result1

map2
result 2

map3
result3
comments

thanks...



More information about the Python-list mailing list