阅读背景:

使用python在linux上编写带有DOS行结尾的文本文件

来源:互联网 

I want to write text files with DOS/Windows line endings '\r\n' using python running on Linux. It seems to me that there must be a better way than manually putting a '\r\n' at the end of every line or using a line ending conversion utility. Ideally I would like to be able to do something like assign to os.linesep the separator that I want to use when writing the file. Or specify the line separator when I open the file.I want to write text files with DOS/Windows lin




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: