Please use code tags. That line worked for me:
>>> line='dhghgjj^Mfjjggjgjg^M'
>>> line = line.replace("^M","")
>>> line
'dhghgjjfjjggjgjg'
>>>
pyTony
pyMod
6,306 posts since Apr 2010
Reputation Points: 879
Solved Threads: 986
Skill Endorsements: 26
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
Posting Maven
2,706 posts since Dec 2006
Reputation Points: 827
Solved Threads: 779
Skill Endorsements: 9
woooee
Posting Maven
2,706 posts since Dec 2006
Reputation Points: 827
Solved Threads: 779
Skill Endorsements: 9