[IPython-user] Re: os.startfile -> infinite loop

Fernando Perez Fernando.Perez at colorado.edu
Thu Sep 1 22:20:49 CDT 2005


Ryan Krauss wrote:
> Unfortunately as a win32 scipy user, I am kind of stuck with 2.3 for 
> now.  I don't have the microsoft compiler, so I can't go to 2.4 and 
> build from source.  (Every time the 2.4 win32 question comes up on the 
> SciPy list it seems like the answer is not yet).
> 
> So what would I need to do to get subprocess working in 2.3?  The main 
> thing I need to do is open a file without waiting for any return.  The 
> problem with popen is that python won't do anything else until I close 
> the dvi viewer and opening and closing the viewer takes extra time so I 
> would prefer not to do it.
> 
> Is subprocess the best way to go for starting a process and not waiting 
> for it to return?  The subprocess docs make it sound like it waits for 
> the process to end.
> 
> The weird thing about all of this is that not all of my win32 machines 
> have this problem and I think they are all identical (obviously 
> something is different).
> 
> I am using os.startfile because is was the only way I could find to 
> start a process and not wait for its return.

Well, as Robert mentioned, it seems subprocess is 2.3 compatible.  You can 
just grab the source file (I've attached it in case you don't have the 2.4 
sources) and drop it into your $PYTHONPATH.  A simple test run with python2.3 
seemed to work on my box.  Give it a try and see how it goes, the module is 
fairly well documented internally.

Cheers,

f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subprocess.py.gz
Type: application/x-tar
Size: 10479 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/ipython-user/attachments/20050901/7d674353/attachment.tar 


More information about the IPython-user mailing list