0

I have a dilema about an approach: I want to execute an OS command, more specifically I want to connect to WiFi. But the problem is: when I call the function it needs time to execute and the GUI freezes. I know why it hangs, I understand how tkinter works. What is my best option here? Should I use Threading or should I use Asyncio? I managed with threads but I did not manage to use async functions without the GUI freezing while executing the function. Can someone suggest some example code if I can do this with async or the safest way possbile? Thank you.

acw1668
  • 40,144
  • 5
  • 22
  • 34
Ivanh23
  • 17
  • 6
  • 2
    Use one of the functions in the `subprocess` module that *doesn't* wait for the command to finish before returning. – jasonharper Nov 10 '20 at 19:21
  • Recently I was struggling to solve **while loop** screen freezing in tkinter and this brilliant answer solved it https://stackoverflow.com/questions/15057789/multiprocessing-in-python-tkinter#15058544 –  Nov 11 '20 at 12:41
  • thank you , will try this tommorow :D – Ivanh23 Nov 11 '20 at 20:26

0 Answers0