Bind compiled code to name?
_karlo_ at _mosor.net_
Sun Jun 22 20:12:00 CEST 2008
If string `source_code` contains Python source code, how can I execute
that code, and bind it to some name? I tried compiling with:
code_object = compile(source_code, 'errorfile', 'exec')
but then what to do with `code_object`?
If my intentions aren't that clear, this is what I'm trying to do. I want
to emulate this:
import some_module as some_name
but with my code in `some_module` string, and not in file.
_______ Karlo Lozovina - Mosor
| | |.-----.-----. web: http://www.mosor.net || ICQ#: 10667163
| || _ | _ | Parce mihi domine quia Dalmata sum.
More information about the Python-list