local variable not found

Alain Tesio alain at onesite.org
Sat Apr 27 19:57:54 EDT 2002


On Sat, 27 Apr 2002 23:17:27 +0200, Alex Martelli wrote:

> Change your eval(...) to an exec ... and it should work.

Thanks, it works fine with exec indeed.

> It's close to impossible that such an approach is
> anywhere like halfway-decent, by the way.  eval and
> exec make sense a tiny percentage of the time, but
> (in my experience) only when used with explicit
> dictionaries, NOT by letting them default to locals()
> and globals().

My problem is to make html templates where the user
can insert python code.
I'm working on a dynamic interface to mailing list
archives : http://onesite.org/exarch/

Alain



More information about the Python-list mailing list