#やりたいこと
gui画面の"start communication"ボタンがクリックされるたびにthread"thread_read_data "を実行させたい
#マルチスレッドライブラリインポート import threading import time #データフレーム定義 class com_master: def __init__(self): #マルチスレッド処理定義 self.thread_read_data = threading.Thread(target = self.process_com_start) def btn_press_com_start(self): self.thread_read_data.start() def process_com_start(self): pass #window作成 root = tk.Tk() #メインウィンドウの作成 root.geometry("450x350") #通信機能classインスタンス生成 ins_com_nucreo = com_master(PC_TO_MST_DATA_SiZE,MST_TO_PC_DATA_SIZE) button_start_com = tk.Button(text = "start communication", command = ins_com_nucreo.btn_press_com_start) button_start_com .pack() root.mainloop()
#エラー内容
"threadは一回きりしかstartできません"。とエラーを出します。
#質問
threadを終了させて再度スタートさせたい場合はどうしたらよろしいでしょうか。お手数をおかけしますが宜しくお願い致します。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/02 11:58
2019/07/02 12:15
2019/07/02 12:35
2019/07/02 12:47
2019/07/03 14:22