What library can I use to implement event driven programming in Python?

  • eventlet
  • Twisted
  • Tornado
  • gevent (either forked or based on eventlet's design)

Of the four, eventlet is probably the quickest to pick up and easiest to use - you don't have to modify a lot of your code to make it event-based in the model of eventlet. It basically does some wrapping of the built-in libraries of python, and can do some runtime monkey patching of your code to make it event-based.


It looks like you want a library like PyDispatcher for signal registration and dispatching rather than an event-loop for networking.


Twisted is for event-driven networking.

Tags:

Python