2

I'm currently programming a python program. The program has two threads. The main thread is running a GUI and the child thread is running some sort of installer. In some point, the child thread, needs to ask the user something (If he wants to install more stuff). In which way can the child thread send a message to the GUI-thread, that it needs to open a pop-up? (i cant use timeouts, only some sort of interuption)

Thank you very much!

Bar Harel
  • 35
  • 5
  • The GIL may be an advantage heare: if you start the second thread as a subclass of GUI class, it has acces to class vars. So you may simple set a value or call a function that will be in main thread context. Ofcourse, the thread will be on the same core... – cox Aug 17 '14 at 09:47

1 Answers1

2

Take a look at Queue.Queue, which is a standard way of handling messages between threads in python. This question has a discussion you might also find useful.

Good luck

Community
  • 1
  • 1
WeaselFox
  • 7,220
  • 8
  • 44
  • 75