A wxpython is trying to run a time consuming task from GUI with the original idea long (by pressing a button) GUI To start the work and after that, a constant text on the dialog should be updated.
I first saw some threading (and many other resources), and I want to show the messages back using Publisher.class. It did not go well, after the message or two, the GUI seems frozen.
Now I want to achieve it with multiprocessing. I have this method inside the 'GUI' class:
def do_update (auto, e): self.txt_updatemsg.SetLabel ("do not stop it \ n") ... pub = publisher () # I was trying to call directly from dbob object # Publisher () is a singleton so it should be useless? Pub.subscribe (auto.__ update_txt_message, ('updatedlg', 'message')) dbob = dbutils.DBUtils () # DBUtils is a class with 'long time' functions dbob.publisher = pub p = process (target = self.do_update_process , Args = (dbob,)) p.is_alive: p.is_alive: wx.Yield def do_update_process (auto, dbob): dbob.do_update ()
__ update_txt_message is a simple task Sets static text on dialog
The question is: how can I send back some text messages (just plain text, this is just me) thanks guys!
Robin Dunn has responded to me in the wxpython mailing list
PubModule is not able to exceed the process boundaries.
So I have fixed my problem using threading, so I have to use classes provided by multiprocessing module, or some other inter-process communication method. Module
Comments
Post a Comment