Re: [PyOpenGL-Users] IDLE, threads and pyopengl
Brought to you by:
mcfletch
From: Shane H. <sha...@ie...> - 2007-03-13 06:09:29
|
ipython is certainly doing this. I saw the demo at PyCon, and have been using it to great effect in debugging and interacting with my wx app. > ipython -wthread Works for wxPython guis. --help gives more options and a bit more insight into it. I'd have a look at what they did to see if it will work for you as is, or for your own cmd-based interactive app. -Shane On Mar 12, 2007, at 10:37 PM, Mike C. Fletcher wrote: > JoN wrote: >> And then he realizes he's asked the completely wrong question. >> >> What I meant to ask was: >> >> Can IDLE - or any python command interpreter for that matter? - be >> run itself as >> a pythread ? >> > There have been systems that used Idle connected up to a GUI with > PyOpenGL running in it. I seem to recall systems with IPython and > a Tk > OpenGL GUI as well. I haven't done it myself, nor do I know if they > actually used threads. Normally what happens is that you need to > arrange to have two event loops running. Some GUIs (wxPython, for > instance) can handle that using threads as long as you make sure that > your first import of wxPython is in the secondary thread (IIRC). > Running an interpreter thread using cmd should allow you to run > that in > a background thread and let the GUI use the main thread AFAICS. > > I code my own systems using something like the wxPython shell widget > hooked up to a wxPython GUI, so the system all runs in the same > thread, > but that has its own challenges when you want a user to code (e.g. > they > want to time.sleep() in a script). > > HTH, > Mike |