如何从python中的文本文件中删除NUL字节

时间:2018-02-21 04:43:41

标签: python-2.7

我的输出文件为每一行创建NUL字节(\ x00)。我在Unix上运行python 2.7,稍后将在Windows上处理文件

with open(inputfile,'w') as f:
           f.write(cmd_output)


command_process = subprocess.Popen(
cmd,
shell=shl,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True
)


 cmd_output = command_process.communicate()[0]

0 个答案:

没有答案