PDA

View Full Version : Python events



Jmccaffrey
April 11th, 2007, 07:04 AM
I am wanting to create an event kernel that tails a log file and throws events based on those parsed from the log in real time. What is the most pythonic way of implementing this design? I can think of several ways to accomplish this, but I hope there is some premade event framework that I can use.

skeeterbug
April 13th, 2007, 12:11 AM
I am wanting to create an event kernel that tails a log file and throws events based on those parsed from the log in real time. What is the most pythonic way of implementing this design? I can think of several ways to accomplish this, but I hope there is some premade event framework that I can use.

Try the observer design pattern.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/415310

:D