Tkinter Freezing Despite Threading
I am currently developing a web scanner that continuously scans for vulnerable URLs. I wanted a GUI for my program and thus chose to use tkinter. Currently I am facing a problem wh
Solution 1:
The thread function posted in the question is calling the nonrecursiveURL function directly, before passing it as the thread target.
defthread(value):
t = threading.Thread(target=nonrecursiveURL(value)) <-- here nonerecursiveURL is being called
To call a function in a different thread, the threading.Thread instance requires a function reference, and an optional list of arguments to be passed to that function.
t = threading.Thread(target=nonrecursiveURL, args=(value,))
now nonrecursiveURL is not called in here, but only passed to the Thread, and will be called in a different thread, when t.start() is called.
You can confirm this issue, by just calling the thread function from Python REPL, leaving Tkinter out of the debugging session.
Post a Comment for "Tkinter Freezing Despite Threading"