Gabriel Genellina 写道: > En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin > <"http://phr.cx"@NOSPAM.invalid> escribió: > >> "J. Peng" <[EMAIL PROTECTED]> writes: >>> print line, >> Do you really want all the lines crunched together like that? If not, >> leave off the comma. > > Remember that Python *keeps* the end-of-line charater at the end of each > line; if you leave out the comma, you'll print them doubly spaced. >
Most languages (AFAIK) keep the newline character at the end of lines when reading from a file.But python's difference is its 'print' built-in function add a newline automatically for you. So without that ',' we will get double newlines. -- http://mail.python.org/mailman/listinfo/python-list