Executing python script stored as a string

Xavier Ho contact at xavierho.com
Tue Sep 1 02:48:55 EDT 2009


On Tue, Sep 1, 2009 at 9:29 AM, Ecir Hana <ecir.hana at gmail.com> wrote:

> - if I understood it correctly defining a function in the string and
> exec-ing it created the function in current scope. This is something I
> really don't want
>

Oops, missed that point.

May I ask what is there you don't want, and what about putting the function
inside a different module and importing? What's so bad about being "in
scope"?

Sincerely,
-Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090901/c57c9a16/attachment.html>


More information about the Python-list mailing list