[Tutor] subprocess and launching an editor
alan.gauld at btinternet.com
Fri Jun 22 18:21:43 CEST 2007
"Jason Massey" <jason.massey at gmail.com> wrote
> gedit launches with a blank file called window1. The python shell
> is now
> waiting for gedit to exit before it does anything else.
> 2nd console
>>>>subprocess.call('gedit --new-window window2',shell=True)
> Another instance of gedit launches with a blank file called window2.
> difference here is that the 2nd python shell instantly returns an
> exit code
> of 0.
Interesting. I suspect this sets a second thread of the same process
off. Can you do a ps to see how many gedit processes are running?
The Gedit Python link might be worth investigatying if you insist
on using gedit. But then your solution might not work for anyone
else... I do with apps wouldn't try to be too clever.
More information about the Tutor