Python Event Driven Programming Model