[問題] subprocess.Popen的問題
請問有關於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)
→
01/15 11:31, , 1F
01/15 11:31, 1F
→
01/15 11:32, , 2F
01/15 11:32, 2F
Python 近期熱門文章
PTT數位生活區 即時熱門文章