Premshree Pillai wrote in message ... >You need to use eval() to run code on-the-fly. See >http://www.python.org/doc/current/lib/built-in-funcs.html Eval only evaluates expressions, not statements. A function definition is a statement. (Think about it: what would eval() return?) -- Francis Avila