Example of and event loop implementation in Python.