+ 1
GUI and functions/loops. Avoid freeze?
I have made a GUI with an start and stop button. The start button will start mutliple functions after eachother. Some of the functions contain loops, some dont. When the start button is pressed the GUI freeze. Whats the best and common way to avoid it?
2 Respuestas
+ 1
You are probably doing work on the main thread, the same message loop as the gui works in, to solve this in other languages like c# you would create a background thread / worker, i'm not really a python fan but i'm sure that's how it would work there as well :).
Here's some resources that might help
https://wiki.wxpython.org/Non-Blocking%20Gui
https://www.tutorialspoint.com/python/python_multithreading.htm
+ 1
You need firstly to be sure that you don't have an infinite loop or another(s) mistake(s) which could be the origin of the freeze ^^
Post your code or a link to it, if you want further help for debuging/searching a solution ;)