Re: [PyOpenGL-Users] IDLE, threads and pyopengl
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2007-03-13 04:37:28
|
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 -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |