exec globals and locals

John Nagle nagle at animats.com
Thu Sep 3 06:08:37 CEST 2009

Chris Rebert wrote:
> On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin<quentin.lampin at gmail.com> wrote:
>> Hi,
>> Being fairly new to Python, I'm trying to figure out the best way to use the
>> exec statement and I must admit that I am a bit lost.

     Generally, if you want to use the exec statement, you're probably lost.
Unless you have a desperate need to execute some code whose content isn't
determined until run time, don't use the exec statement.  If the code
comes from an external source, you're probably creating a security hole.

					John Nagle

More information about the Python-list mailing list