Please use code tags. That line worked for me:
>>> line='dhghgjj^Mfjjggjgjg^M'
>>> line = line.replace("^M","")
>>> line
'dhghgjjfjjggjgjg'
>>>
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
File "par.py", line 6
line = line.replace("
^
Note the mark at the beginning of the line, which usually means the problem is the previous line.
## test with this first
for line in fileinput.FileInput(files="./test.txt"):
print line
#
## iterates over the lines of all files listed in sys.argv[1:]
for line in fileinput.input():
##
## otherwise use
for line in open("./test.txt", "r"):
print line
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714