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

Fernando Perez Fernando.Perez at colorado.edu
Mon Aug 15 16:08:04 CDT 2005

Ryan Krauss wrote:
> I have an interesting problem with os.startfile and Ipython.  I have a 
> script that generates a LaTeX file and runs LaTeX.  I then open the 
> output with os.startfile.  On my computer at home, I have no problems.  
> On the computer in my office, I have no problems if I run pdflatex and 
> open a pdf file (with Acrobat).  However, if I generate a dvi file and 
> open it with YAP, it starts an infinite loop.  I know this sounds 
> crazy.  I will attach the python script.
> If I comment out this line
> os.startfile(ostr)  (line 77)
> the code exits normally.

I'm afraid I won't be able to help: os.startfile seems to be a win32-specific 
function, since it's not part of the generic os module:

In [4]: os.startfile
exceptions.AttributeError                            Traceback (most recent 
call last)


AttributeError: 'module' object has no attribute 'startfile'

The behavior you describe does indeed sound nuts: I have no idea what can be 
possibly causing that.

Are you using ipython's %run command to run it?  Because %run is just a fancy 
wrapper around execfile().  Try from within ipython both using

run noncolocated

and also


Also try the latter from a plain python prompt.  Let me know what happens, and 
we might have some ideas.



More information about the IPython-user mailing list