[IPython-dev] glumpy, fast opengl visualization

Nicolas Rougier Nicolas.Rougier at loria.fr
Thu Jan 28 03:47:12 EST 2010


Hi,

I modified the sources to use ask_exit but I still have problems. 
In glut (not freeglut), the only way to exit the mainloop is to exec
sys.exit() and this is a problem for the IPython shell that seems to be
unable to exit cleanly in such a case (I use atexit to catch the exit).
It lefts the tty in a weird state (no echo) and I need to save the tty
state using termios to restore it properly before exiting. I think this
problem is very specific to glut (which is rather old anyway) and I'm
not sure there is smarter fix.

Nicolas



On Tue, 2010-01-26 at 01:02 -0800, Fernando Perez wrote:
> Dear Nicolas,
> 
> On Tue, Jan 26, 2010 at 12:23 AM, Nicolas Rougier
> <Nicolas.Rougier at loria.fr> wrote:
> > I will change the license from GPL to BSD.
> 
> Well, many thanks!  I greatly appreciate this gesture, I'm sure it
> will benefit us all.
> 
> > Concerning the ipython-trunk, I'm not sure where to look exactly within
> > your sources. Currently, I'm using the IPython.ipapi.launch_new_instance
> > to start an ipython shell in its own thread (I need this because OpenGL
> > requires to be in the main thread from what I remember). Furthermore I
> > proxy all gl calls so they are executed within the main thread while
> > standard python operations are made directly from the ipython thread.
> >
> > The only problem so far with this approach is to be able to kill the
> > IPython session cleanly from the GL thread but I did not find the way to
> > do it, is there something like this in the dev branch ?
> 
> A few points:
> 
> - You may want to simply try to do what %Exit does:
> 
>     def magic_Exit(self, parameter_s=''):
>         """Exit IPython without confirmation."""
> 
>         self.shell.ask_exit()
> 
> I unfortunately can't verify if this works, because with your current
> hg code on my Karmic 32-bit laptop, I get this:
> 
> maqroll[glumpy]> python -c 'import glumpy'
> Segmentation fault
> 
> so none of the demos run at all.
> 
> - Just a couple of days ago, Brian and I started thinking hard about
> the long-term design requirements of the interactive app for civilized
> cooperation with other mainloops (like what you need).  Let us know if
> the above basic trick doesn't work, and very soon we'll try to finish
> up the current reviews in-progress and put up some design docs on
> these questions, so we can start building up with glumpy as cleanly as
> possible.
> 
> 
> Great timing!  Last we'd spoken I said it would be a while before
> things got cleaned up enough to really make sure we weren't wasting
> your time, but you came back just as things are getting in shape over
> here.  This should be fun :)
> 
> Best regards, and many thanks again for your consideration of my
> licensing discussion,
> 
> f





More information about the IPython-dev mailing list