running multiple scripts -- which way is more elegant?
Florencio Cano
florencio.cano at gmail.com
Mon Jun 20 10:19:55 EDT 2011
> Unfortunately I have not been able to
> work out how to get the imports to work.
>
> import config_script obviously doesn't work and __import__(config_script)
> works from the python interpreter but fails in the script (ImportError:
> Import by filename is not supported.)
You can use this:
exec("import " + module_name)
More information about the Python-list
mailing list