[Tutor] Passing a variable to 'import'

alan.gauld@bt.com alan.gauld@bt.com
Thu, 20 Dec 2001 10:53:23 -0000


> > So how do I, for example, grab a module name from sys.argv 
> and then pass it to the import command as a variable?
> 
> You'll want to look at the "imp" module.
> 
> http://www.python.org/doc/current/lib/module-imp.html
> 

Oh well, wrong again! exec isn't the best way 
- once more Python's "battery power" impresses me :-)

Alan g.