[Tutor] manipulating a file
Smith, Jeff
jsmith at medplus.com
Mon Feb 7 20:58:03 CET 2005
-----Original Message-----
From: Alan Gauld [mailto:alan.gauld at freenet.co.uk]
Sent: Monday, February 07, 2005 2:49 PM
To: Reed L. O'Brien; tutor at python.org
Subject: Re: [Tutor] manipulating a file
>You should add a newline character otherwise you will just
>get one enormously long line!
>
> dstfile.write(i+'\n')
In these cases, I've taken to doing
print >> dstfile, I
...hmmm starting to look like Perl's many ways to accomplish the same
thing approach :-)
Jeff
More information about the Tutor
mailing list