いくつかのプロセスのために新しいトップレベルウィンドウでpython 3で不確定な進行状況バーを作成しようとしています。そのプロセスのスレッド。私が望むのは、プログレスバーが始まり、スレッドもバックグラウンドで起動され、スレッドの実行が完了するとすぐに、タスクが完了したというメッセージが表示されます。スレッドをバックグラウンドでバックグラウンドで開始し、スレッドを開始し、スレッドがPythonで完了した後で再び操作を行う方法
コード:thread1.join()が呼び出された場合
class myThread(threading.Thread):
def __init__(self, threadID):
threading.Thread.__init__(self)
self.threadID = threadID
def run(self):
print("Starting the thread")
func()
print("Ending the thread")
def func():
some task
...
new_top = Toplevel()
new_top.title("New Top Level")
new_top.geometry("400x170")
label = Label(new_top, text='Doing some work', justify=CENTER, bg="#CBFDCB").place(x=43,y=30)
progress_bar = ttk.Progressbar(new_top, orient="horizontal", mode="indeterminate", takefocus=True, length=320)
progress_bar.place(x=40, y=80)
progress_bar.start()
thread1 = myThread(1)
thread1.start()
thread1.join()
...
実行後のスレッド操作
は私の問題は何ですか、ラベルやプログレスバーを持つトップレベルのウィンドウが表示されませんし、私はこれをスキップした場合スレッド実行後の操作は実行されません