失败标准错误重定向: (echo a >/dev/stdout;echo b >/dev/stderr) 2>&1 >test2.log;ls test2.log;cat test2.log 所以,上面将输出: “b” 的末端,并且将记录 “一” 此不能登录stderr的太: (echo a >&1;echo b >&2) 2>&1 >test2.log;ls test2.log;cat test
作为问题状态,我不明白为什么输出是在两个单独的行而不是一个。这里是我的代码: import os
items=os.listdir("C:/output")
for names in items:
if names.endswith(".txt"):
with open('C:/output/' + names, encoding="utf8") as current