After launching a process using subprocess.Popen() as shown, I would like to create a busy-window (wx.Dialog) with an "Abort"-button. This works as intended; however, in the case where the process is given the time needed to finish, the busy-window should be destroyed. In the code shown below, this does not happen?
import subprocess
import wx
ProcessToCall = [Some, process, with, some, arguments]
Process = subprocess.Popen(ProcessToCall)
BusyDialog = wx.Dialog(...)
if BusyDialog.ShowModal() == wx.ID_CANCEL:
Process.kill()
Process.wait()
BusyDialog.Destroy()
I've been experimenting with EndModal and various other methods of wx.Dialog and consulted various tutorials online, but nothing seems to achieve the desired effect, and I'm all out of ideas.
I'm using Python 2.7 and wxPython 2.8 on Ubuntu 13.10.