On Tue, Aug 7, 2012 at 6:00 PM, Gelonida N <gelon...@gmail.com> wrote:
> modulename = 'my.module'
> cmd = 'import %s as amodule'
> try:
>     exec(cmd)
>     print "imported successfully"

Someone will doubtless correct me if I'm wrong, but I think you can
avoid exec here with:

amodule=__import__(modulename)

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to