Not able to read blank lines and spaces on a small text file
pfortin at pfortin.com
Mon Sep 13 17:06:47 CEST 2004
On 13 Sep 2004 07:48:14 -0700 Ruben wrote:
> I am trying to read a small text file using the readline statement. I
> can only read the first 2 records from the file. It stops at the blank
> lines or at lines with only spaces. I have a while statement checking
> for an empty string "" which I understand represents an EOF in Python.
> The text file has some blank lines with spaces and other with blanks.
An empty record is not the same as "no record"...
> while record != "":
More information about the Python-list