Newbie question about file input

Christopher T King squirrel at WPI.EDU
Tue Aug 17 10:16:09 EDT 2004


On Tue, 17 Aug 2004, Aaron Deskins wrote:

>     Also, what exactly is stored when a blank line is read by the
> readline command? A zero, blank, or what???

readline() always includes the '\n' that terminates the line, so any 
'blank' line that is read will be returned as a simply '\n'.  The only 
time readline() won't return a line terminated with '\n' is if the last 
line of the file isn't terminated with '\n' (common on Windows), in which 
context a blank line is meaningless.




More information about the Python-list mailing list