I\'m writing a Python application that takes as a command as an argument, for example:
$ python myapp.py command1
I want the application to
If you want it in your locals:
>>> mod = 'sys' >>> locals()['my_module'] = __import__(mod) >>> my_module.version '2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]'
same would work with globals()
globals()