Char handling DOS vs Linux?

David Lees debl.spammono.nospammy at world.std.com
Tue Sep 19 23:18:31 EDT 2000


Hey Aahz, thanks for the quick and correct diagnosis.  I should have
posted the "open" statements, but you got it right.  One minor thing is
that the output also requires a binary write:

input=open(sys.argv[1],'rb')
output=open(sys.argv[2],'wb')

david lees

Aahz Maruch wrote:
> 
> In article <39C81033.DBC3D150 at world.std.com>,
> David Lees  <debl.spammono.nospammy at world.std.com> wrote:
> >
> >I wrote a short piece of python code running under 1.5.2 for striping
> >out those extra carriage returns that DOS editors stick into text.  When
> >I run this on my Linux box all works fine.  When I run the same code
> >under Win 95 it does nothing.  It appears from using the debugger that
> >the '\r' carriage returns are never seen when running under Windows.  Is
> >there a different Python I/O function I should be using to see ALL the
> >charaters in a file?
> 
> f = open ( filename, "rb" )
> --
>                       --- Aahz (Copyright 2000 by aahz at pobox.com)
> 
> Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
> Hugs and backrubs -- I break Rule 6
> 
> Member of the Groucho Marx Fan Club  --Aahz



More information about the Python-list mailing list