Problem with tkinter & spawning processes
nnever50 at yahoo.com
Wed Mar 15 10:31:35 CET 2000
I've tried with
os.system('start "C:\Program Files\Python\Python.exe" -i test.py')
and the new process starts fine. But if I try to get back to the GUI the
test.py process is killed.
Then I've tried with the program that you gave me with the link
Till the following lines it runs
spawnv = os.spawnv
but nothing happens :-/
My problem is that the new process that I start from the GUI, must run while
I 'work' on the GUI.
thank you anyway..
Fredrik Lundh <effbot at telia.com> wrote in message
news:Qotz4.1812$74.26417 at newsc.telia.net...
> nathan <nnever50 at yahoo.com> wrote:
> > I've programmed a GUI with Tkinter and I've started it with the
> > mainloop() as usual. Now, I want to start a new process from
> > the GUI, by pressing a button.
> > I've tried with:
> > os.system('"C:\Program Files\Python\Python.exe" -i test.py')
> > The new process starts fine (standard output on the DOS cmmand
> > prompt) nd I cannot do anything more.
> > It seems that the new started process blocks the mainloop() thread
> the os.system call doesn't return until the new process
> has terminated.
> > How can avoid this?
> this might work:
> os.system('start "C:\Program Files\Python\Python.exe" -i test.py')
> or you could use os.spawn(os.P_NOWAIT, ...). see
> (tweaking that script to support a wait/nowait flag is
> left as an exercise for the reader)
> <!-- (the eff-bot guide to) the standard python library:
More information about the Python-list