I have a GUI built in WxPython. I also have a function in the same python script with embedded JSON objects, which I want to call the function as a thread (Background Process)
I want to capture the output of this thread to redirect it to a Multiline text box in the GUI.
I was able to do this with subprocess.popen , but now I want to do it in a thread and I am not able to use proca.stdout in threads just like subprocess. Any help on this will be greatly appreciated.
Thanks! PR
wxpython requires that some things be called from the main thread. This can be accomplished via calls to
wx.CallAfter
orwx.CallLater
or by creating and posting your own custom event.wx.TextCtrl.SetValue
appears to be thread safe. There are several examples of how to implement threads with wxpython, but here's another: