[Tutor] independent process
BELSEY, Dylan
dylan.belsey@baesystems.com
Wed Oct 23 03:14:02 2002
OK, I have just been shown a possible solution to this problem.
os.system("start %s" %(self.DB_GUI))
Using "start" will create an independent process in DOS/Windows
systems. However, is there a Python, platform independent way of doing
this. I am also open to any other solutions that people may have.
Dylan
-----Original Message-----
From: BELSEY, Dylan [mailto:dylan.belsey@baesystems.com]
Sent: Wednesday, 23 October 2002 16:27
To: 'tutor@python.org'
Subject: [Tutor] independent process
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
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor