Do you have any code snippet to get started? Ultimately what I'd like
is to exit the event loop whenever polling stdin returns True, and let
PyOS_Inputhook restart it whenever it wants. That's exactly what the
code posted above does, but using threads sounds more efficient
(although not simpler).

On Aug 27, 8:16 pm, Tristam MacDonald <[email protected]> wrote:
> On Sat, Aug 27, 2011 at 7:32 PM, hugo <[email protected]> wrote:
> > I really like the idea!
>
> > By the way, does anyone know if pyglet offers a way to automatically
> > monitor stdin during its event loop? I mean other than manually
> > rewriting it such as Nicolas did?
>
> Having  spent some considerable time on the problem, the only portable way
> to achieve 'polling' of stdin, is to spawn a separate thread for that task,
> and given Python's hideous issues with respect to threading, I don't
> terribly like that as a solution.
>
> It does however work, and we could conceivably come up with something that
> you can just plug into the existing piglet run loop.
>
> --
> Tristam MacDonald
> System Administrator, Suffolk University Math & CS 
> Departmenthttp://swiftcoder.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to