help me
dataangel
k04jg02 at kzoo.edu
Sat Oct 9 23:19:49 EDT 2004
Richard Blackwood wrote:
> <SNIP>
>
>>
>> Like regular expressions, in the hands of a beginner exec
>> and eval() lead to code that is one or more of dangerous,
>> unreadable, unmaintainable, awkward, or just plain sloppy.
>>
>> -Peter
>
>
> He's got to learn somehow! LOL
Well, I remember looking up the exec keyword and it saying executes a
string. Thus, it seemed like the normal way to execute a string, lol.
Using globals() makes sense, but using locals() doesn't because it won't
have the desired effect. locals() returns a _copy_, globals() is an
actual reference.
More information about the Python-list
mailing list