Super-rexex?
Gordon McMillan
gmcm at hypernet.com
Thu Dec 23 23:22:26 EST 1999
> Gerrit Holl asked:
> [Super rexec for execfile() with strings only?]
>
> Fred L. Drake, Jr. answered:
> [ConfigParser module]
>
> Gordon McMillan reacted:
> [shlex module]
>
> They both don't seem to be what I want.
> I'm reinventing the wheel if I use them. *All* I want is having a
> dictionairy with the same string rules Python uses. Not many
> users will need to see the file: only translators will.
You _did_ ask for something completely safe. Perhaps this
will suit your needs:
g = {'__builtins__' : None}
execfile(file, g)
del g['__builtins__']
- Gordon
More information about the Python-list
mailing list