Ask a python3 tkinter multithreading problem

for i in range (len (answers)):

submitdata = answers[i]
self.threading_run(submitdata)


def threading_run (self,submitdata):
requests.post.

is there any way to use single thread to simulate 1. To operate, now I use the tkinter, main thread will card the main interface,
can I use the thread, only after the first thread has finished running, to execute the second thread

I changed him to

for i in range (len (answers)):

submitdata = answers[i]
-sharpself.threading_run(submitdata)  -sharp
T = threading.Thread(target=self.threading_run, args=(submitdata,))  -sharp
T.start()
T.join()

found that the interface is stuck again. What to do.

Mar.16,2021

python3 has a gil lock, multithreading is fake, and cpu executes only one thread at a time, so your main interface is stuck. Consider switching to co-programming or multi-process to achieve asynchronism


you can't use t.join (),. This is no different from Synchronize execution

.
Menu