"Kent Johnson" <[email protected]> wrote
On Thu, Mar 26, 2009 at 2:58 PM, ALAN GAULD <[email protected]>
wrote:
Use '\n'.join(handle[1:])
It will create a string from your list with newline as separator.
The lines from readlines() include the newlines already.
Ah, OK, I couldn't remember if readlines stripped them off or not.
print>>out, handle[1:]
In the out file, it saves the lines as a list rather than as a string.
use
out.writelines(handle[1:])
Or if you really want to use the print style
print>>out, ''.join(handle[1:])
ie join the lines using an empty string.
Alan G
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor