Not able to read blank lines and spaces on a small text file
peter at semantico.com
Mon Sep 13 17:04:14 CEST 2004
> 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.
My brain is not really working but a blank line is not how python processes a
Try something like:
input_file = open("C:/Documents and Settings/ruben/My
for line in input_file:
More information about the Python-list