[問題] 要如何顯示出shell script內的log

看板Python作者 (Rick-Zeng)時間8年前 (2017/09/22 17:17), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串1/1
手機排版很傷眼睛 各位程式高手,小弟初學者 目前遇到瓶頸 想用試試看在python下執行shell script 然後show出此shell script的執行log ,一行一行列出 使用過subprocess.popen communicate, stdout 發現都是最後執行shell script完畢後才出現 想要的內容 因為我不想在背景下看不到執行過程 tkinter介面會出現“沒有回應“ 所以想要找個辦法去解 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.217.227.71 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1506071831.A.D56.html

09/22 23:15, , 1F
我的做法是 myscript.py > temp.txt read temp del temp
09/22 23:15, 1F

09/22 23:26, , 2F
查了一下 應該是這個 https://goo.gl/2nJQGv
09/22 23:26, 2F
文章代碼(AID): #1PnDKNrM (Python)