Cannot import a module from a variable

Fredrik Lundh fredrik at pythonware.com
Tue Oct 17 07:03:39 EDT 2006


Tim Williams wrote:

> eval( 'reload(%s)' % modname)

reload takes a module object, not a module name.  since you need to have the
object, you might as well pass it to the reload() function.

</F> 






More information about the Python-list mailing list