0
我试图运行:错误运行在Python子()调用时
try:
with open(subprocess.PIPE, 'w') as pipe:
call(["/usr/sbin/atms","-k"], stdout=pipe, stderr=pipe)
call(["/usr/sbin/atms","/usr/sbin/atms.conf"],stdout=pipe,stder=pipe)
except Exception, e:
print e
我现在得到
coercing to Unicode: need string or buffer, int found
是什么意思?
感谢
没有必要使用'os.devnull'重定向标准输出或犯错。只需使用'subprocess.PIPE'并忽略输出。 –
好吧..试试吧..它的意思是将代码中的行替换为subprocess.PIPE而不是os.devnull? –
正;如果你可以管道和忽略,不需要重定向到'/ dev/null'。我并不是说这会解决你的问题,只是使用'/ dev/null'是一个shell解决方案,这就是Python。 –