print dos format file into unix format

PengYu.UT at PengYu.UT at
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,


More information about the Python-list mailing list