Learn how to code event loops in Python