Re: print dos format file into unix format

2006-10-27 Thread Magnus Lycka
Tim Roberts wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Suppose I have a dos format text file. The following python code will >> print ^M at the end. I'm wondering how to print it in unix format. >> >> fh = open(options.filename) >> for line in fh.readlines() >> print line, > > Are

Re: print dos format file into unix format

2006-10-22 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Suppose I have a dos format text file. The following python code will > print ^M at the end. I'm wondering how to print it in unix format. > > fh = open(options.filename) > for line in fh.readlines() > print line, > > Thanks, > Peng Python ships with two utility script

Re: print dos format file into unix format

2006-10-21 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >Suppose I have a dos format text file. The following python code will >print ^M at the end. I'm wondering how to print it in unix format. > >fh = open(options.filename) >for line in fh.readlines() > print line, Are you running this on Unix or on D

Re: print dos format file into unix format

2006-10-21 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Suppose I have a dos format text file. The following python code will > print ^M at the end. I'm wondering how to print it in unix format. > > fh = open(options.filename) > for line in fh.readlines() > print line, > > Thanks, > Peng > open(outfile, "wb").write(open(i

print dos format file into unix format

2006-10-21 Thread [EMAIL PROTECTED]
Suppose I have a dos format text file. The following python code will print ^M at the end. I'm wondering how to print it in unix format. fh = open(options.filename) for line in fh.readlines() print line, Thanks, Peng -- http://mail.python.org/mailman/listinfo/python-list