print dos format file into unix format

PengYu.UT at gmail.com PengYu.UT at gmail.com
Sat Oct 21 18:17:47 EDT 2006


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




More information about the Python-list mailing list