Hi there,
I have a question. How to run an external program from wxPython app so
that before the external program starts it lowers the window and once
finished it raises the window?
I tried something like that:
def onDoExternal(self, evt):
self.Lower()
# run cmd
th=threading.MyThread("sth", self, self.cmd)
th.start()
# wait till cmd finishes (5 sec is enough)
time.sleep(5)
# kill my thread softly (see Python Cookbook rec. 6.2
# Terminating a Thread)
# terminate here!
th.join()
def cmd(self):
# do something here
# os.popen(...) could be here
os.system("cmd")
MyTread's join method has a call to self.Raise(), (a window instance is
passed to the MyThread's constructor)
In the result window doesnt' lower. What do I do wrong?
Many thanks,
~Serge
···
+++++
This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.