[問題] subprocess.Popen的問題

看板Python作者 (A動動)時間13年前 (2013/01/14 21:08), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
請問有關於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
原來是NCFTP本身的問題...
01/15 11:32, 2F
文章代碼(AID): #1Gz0CuaJ (Python)
文章代碼(AID): #1Gz0CuaJ (Python)