python—对txt文件中的换行”\r\n”替换成空白”“
root@kali:~/python# cat replace2txt.py
#!/usr/bin/python
# --*-- coding:utf-8 --*--
f1 = open("/root/python/2.txt").read()#打开要替换的文件
f2 = f1.replace("\r\n","")
f3 = open("/root/python/frxxz.txt","wb")#替换成功后的文件
f3.write(f2)
f3.close()
root@kali:~/python#