Possible to import a module whose name is contained in a variable?

2005-03-06 Thread Steven Reddie
Hi, I want to do something like the following, which doesn't work: modulename = 'module' import modulename The error is that there is no module named 'modulename'. Is there a way to get that variable expanded? Regards, Steven -- http://mail.python.org/mailman/listinfo/python-list

RE: Possible to import a module whose name is contained in a variable?

2005-03-06 Thread Steven Reddie
-- From: Hye-Shik Chang [mailto:[EMAIL PROTECTED] Sent: Monday, 7 March 2005 4:48 PM To: Steven Reddie Cc: python-list@python.org Subject: Re: Possible to import a module whose name is contained in a variable? On 6 Mar 2005 21:34:08 -0800, Steven Reddie <[EMAIL PROTECTED]> wrote: > Hi, &g