[Tutor] deleting CR within files

David Talaga dtalaga at novodynamics.com
Mon Apr 19 11:24:06 EDT 2004

To all concerned:
Thank you so much for all the help!  The project is done!!

-----Original Message-----
From: Alan Gauld [mailto:alan.gauld at blueyonder.co.uk]
Sent: Saturday, April 17, 2004 3:47 PM
To: David Talaga; Roger Merchberger; tutor at python.org
Subject: Re: [Tutor] deleting CR within files

> for i in in_file:
>       out_file.write(i[:])
> This does what I need with the excpetion that it dosent do it for
> line.  It is currous because it will take off a <cr> from one line
and not
> the next 2 and then from another line...  currious...

Are you sure thats not the origoinal data?

Try using the strip function since it will only strip off if there
is anything to strip so should work in all cases.

ie.   out_file.write(i.strip())


Alan G

More information about the Tutor mailing list