print dos format file into unix format

PengYu.UT at gmail.com PengYu.UT at gmail.com
Sun Oct 22 00:17:47 CEST 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