Question: Event driven programming

Chris Liechti cliechti at
Sat Oct 27 23:59:25 CEST 2001

"Károly Ladvánszky" <aa at> wrote in
news:3bdb0140_5 at 

> What I have in my mind is not necessarily UI related. In VB, objects
> can raise events, objects interested in the events will handle them.
> Thats a very simple mechanism, facilitates easy coding in many
> situations, even if its just a console application with no GUI at all.
> They are similar to exceptions but they return to the caller and they
> can have parameters/return values of any kind.

that sound like an "observer pattern" for me.... it is a common thing to do 
in OO languages. it's not a feature of a language but more a idea that can 
be implemented in various ways and languages.
Java has an observer pattern implementation in it library, for Python you 
can take the code from the URL below.

make a module with the "Subject" and "Observer" classes then you can simply 
inherit from them in your own classes.

here's an implemenation example:

Chris <cliechti at>

More information about the Python-list mailing list