私はスタックオーバーフローのいくつかのポストを読んだことがあります。Issues intercepting subprocess output in real time、Redirect command line results to a tkinter GUI、私はtkinterでスレッディングとキューを使用する必要があることを知っていますが、私はまだ同じことをすることができませんプログラムの初心者、助けてください。Tkinterスレッディングとテキストウィジェットに戻る
目標:ときにボタンを押し、Tkinterのテキストウィジェット内の「トップ」コマンドの出力とリアルタイム表示を取得
問題:私は、コードを追跡しようとしたが、それでも取得することはできません出力が、私はそれを動作させる方法を考えていない。
from tkinter import *
import tkinter as tk
import subprocess
from threading import Thread
from queue import Queue
window = tk.Tk()
window.title('realtime')
window.geometry('800x400')
text = tk.Text(window)
text.pack()
button = tk.Button(window, text= 'Press')
button.pack()
window.mainloop()
これが唯一のGUI見通しで、
私の他の質問をお手伝いできますか?[リンク](http://stackoverflow.com/questions/43388789/use-variable-in-different-class) – Ethan