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

Robert Kern rkern at ucsd.edu
Thu Sep 1 22:24:59 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).

Well, John Hunter is building matplotlib binaries with mingw for 2.4
with this distutils patch:

http://mail.python.org/pipermail/python-list/2004-December/254826.html

Since scipy needs a FORTRAN compiler, preferably g77, the MS compiler
wouldn't help much anyways.

> So what would I need to do to get subprocess working in 2.3? 

Just drop in the file subprocess.py . Or use this installer:

http://effbot.org/downloads/subprocess-0.1-20041012.win32-py2.3.exe

> 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.

You're probably right. On UNIX, I would add a "&" to the end of the
command string to specify that the process should background itself
(with shell=True of course). Does CMD.EXE (or whatever it's called these
days) have something similar?

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the IPython-user mailing list