[Tutor] independent process
BELSEY, Dylan
dylan.belsey@baesystems.com
Wed Oct 23 02:23:02 2002
Hi Tutors,
I need some advice on how to run an independent application from
within Python.
Here is the scenario. I am using WinNT, with Python 2.1.1 and
Tkinter (inc. Pmw) for my GUIs. Currently I have created a GUI that has
three buttons on it. The first button initiates a system command to create
a text file and a .dat file, from a binary file, by calling a prewritten C++
utility (in executable form). The second button also runs a system command
to load a database using the .dat file. The command looks something like:
"mysql < SignalRecording1.dat"
It is the third button that I am having trouble with. I need this
button, when pressed, to start up a front-end to the database, by calling
the front-end's executable. Currently I am using MySQL-Front. I have put
the location of the .exe in an environment variable. So I interrogate the
variable using:
self.DB_GUI = os.getenv("DB_GUI")
and then run either:
os.system("%s" %(self.DB_GUI))
or
CommandEnv = os.popen3("%s" %(self.DB_GUI))
My problem is that with either of these commands, the GUI containing
the buttons hangs until I close the MySQL-Front application. Is there away
to spawn this as a totally independent process/application so that the user
can close the initial GUI or keep using it without having to quit the
front-end? Note: I am using Windows.
TIA,
Dylan