Mark Hammond wrote: > : Currently, event loops are available in Python via PyOS_InputHook, a > : pointer to a user-defined function that is called when Python is idle > : (waiting for user input). However, an event loop using PyOS_InputHook > : has some inherent limitations, so I am thinking about how to improve > : event loop support in Python. > > Either we have an unusual definition of "event loop" (as many many other > toolkits have implemented event loops without PyOS_InputHook), or the > requirement is for an event loop that plays nicely with the "interactive > loop" in Python.exe. I would guess there is an unusual definition of an "event loop". It is probably that inside the hook, a "process_some_events()" function is invoked, which loops until some event queue is empty; this is not the usual infinite-loop-until-user-terminates-program. For this to work, you need a guarantee that the hook is invoked frequently. Again, I still think running the loop (as a true event loop) in a separate thread would probably solve the problem. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4