I&#39;m running Feisty as well.<br><br>I launched python in two separate consoles and tried this:<br><br>1st console<br>----------------<br>&gt;&gt;&gt;import subprocess<br>&gt;&gt;&gt;subprocess.call(&#39;gedit --new-window window1&#39;,shell=True)
<br><br>gedit launches with a blank file called window1.&nbsp; The python shell is now waiting for gedit to exit before it does anything else.<br><br>2nd console<br>---------------<br>&gt;&gt;&gt;import subprocess<br>
&gt;&gt;&gt;subprocess.call(&#39;gedit --new-window window2&#39;,shell=True)<br>
<br>Another instance of gedit launches with a blank file called window2.&nbsp; The difference here is that the 2nd python shell instantly returns an exit code of 0.&nbsp; <br><br>So you can definately launch multiple instances, but I&#39;m not sure how you would determine when the user was done editing the file after the first instance of gedit has been launched.
<br><br><div><span class="gmail_quote">Perhaps you could use this:<br><br><a href="http://live.gnome.org/Gedit/PythonPluginHowTo">http://live.gnome.org/Gedit/PythonPluginHowTo</a><br><br>If you&#39;re going to stick with gedit.
<br><br>On 6/22/07, <b class="gmail_sendername">Brian van den Broek</b> &lt;<a href="mailto:broek@cc.umanitoba.ca">broek@cc.umanitoba.ca</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I want to have a script launch an editor open to a particular file and<br>wait until that editor has closed before continuing. The aim is to<br>allow the user to make edits to the file, have to script know that the
<br>edits are completed, and then make use of the newly saved file contents.<br><br>gedit is the default text editor on my ubuntu feisty system, so in the<br>first instance, I&#39;ve tried to do this with gedit. The subprocess.call
:<br><br> &gt;&gt;&gt; subprocess.call(&quot;gedit somefilename&quot;, shell=True)<br><br>works just fine *provided* that no instance of gedit is running when I<br>invoke .call. However, if there is a gedit window up and running
<br>(there usually is on my system ;-), the .call immediately returns exit<br>status 0:<br><br> &gt;&gt;&gt; subprocess.Popen(&quot;ps -e|grep gedit&quot;, shell=True)<br>&lt;subprocess.Popen object at 0xb7d06b4c&gt;<br> &gt;&gt;&gt; 26066 pts/2&nbsp;&nbsp;&nbsp;&nbsp;00:00:01 gedit
<br><br> &gt;&gt;&gt; subprocess.call(&quot;gedit somefilename&quot;, shell=True)<br>0<br> &gt;&gt;&gt; # The exit code is produced instantaneously<br><br>Interestingly, it works just fine if I use emacs in place of gedit,
<br>irrespective of whether emacs was running before the subprocess.call<br>invocation or not. Is there any way to get it to work with gedit as it<br>is with emacs?<br><br>I am largely ignorant of the family of modules which subprocess was
<br>designed to replace, and also of the details of processes on linux.<br>(In particular, I&#39;ve no clue why gedit and emacs behave differently in<br>this respect.)<br><br>Thanks and best,<br><br>Brian vdB<br>_______________________________________________
<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>