File Iterator - Print - Double New Lines

Peter Hansen peter at engcorp.com
Sat Jun 1 17:49:14 EDT 2002


Mike Brenner wrote:
> 
> print "QUESTION: Why did it jump from NO LINE SPACING to DOUBLE SPACING?"
> print "QUESTION: How to get SINGLE SPACING?"
> print
> print "Using Python 2.2.1, it does the same under win32all build 142 and "
> print "      running it from a DOS box without the windows extensions."

[snip code with troubles]

Mike, the print statement adds newlines after every line it prints.
If you want to see the real contents of the file, use sys.stdout.write().
Alternatively, you might want to strip the newlines from each line
as you read them in.  Depends what you are trying to do.

-Peter



More information about the Python-list mailing list