How to use the exec statement
Alex Martelli
aleax at aleax.it
Sat Oct 5 10:41:52 EDT 2002
More information about the Python-list mailing list
Sat Oct 5 10:41:52 EDT 2002
- Previous message (by thread): How to use the exec statement [PREMATURE]
- Next message (by thread): How to use the exec statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
JB wrote: > I should like to unse the exec statement. The code should be > executed in the global namespace of the current module, but > I do not know the name of the name space deictionary. Built-in function globals() returns the global namespace's dictionary. But it's extremely unlikely that exec is the best solution to your problem, particularly exec in an existing namespace -- you have no control of what names defined in that namespace get trampled. If you explain what you're trying to do with exec, it's possible that better suggestions can be advanced regarding how to perform that. Alex
- Previous message (by thread): How to use the exec statement [PREMATURE]
- Next message (by thread): How to use the exec statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list