How can I remove the ^M
character from a text file (at the end of line) in a Python script?
I did the following, and there are ^M
at every line-break.
file = open(filename, "w")
file.write(something)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…