作者localhostphp (A动动)
看板Python
标题[问题] subprocess.Popen的问题
时间Mon Jan 14 21:08:05 2013
请问有关於Popen的问题
(这程式主要是是抓NcFTPPUT的执行结果)
部分程式码
p = subprocess.Popen(newCommand,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
return p.communicate()
执行结果 有test.dat的是系统print(stdout)的地方,也就是我想抓的地方。
***************result***************
test.dat: ETA: 0:00 37.00/ 37.00 B 0.00 B/s te
test.dat: 37.00 B 296.02 B/s
test.dat: 37.00 B 296.02 B/s
test.dat: 37.00 B 296.02 B/s
test.dat: 37.00 B 296.02 B/s
这里是 id,p.communicate() #id请不用管他...
4 ('', '')
5 ('', '')
请问我已经把stdout 用到PIPE了,为什麽输入还是''?
其他有错误的用到 stderr 倒是蛮正常的...
谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.32.94.176
※ 编辑: localhostphp 来自: 114.32.94.176 (01/14 23:38)
2F:→ localhostphp:原来是NCFTP本身的问题... 01/15 11:32