Re: Importing module with name given as a variable

2008-08-30 Thread Bruno Desthuilliers
Sean Davis a écrit : What is the "best practice" for importing an arbitrary module given that the name is stored in a variable? The context is a simple web application with URL dispatching to a module and function. I know of __import__(), the imp module, and exec. For each of these, is there a

Re: Importing module with name given as a variable

2008-08-30 Thread Wojtek Walczak
On Sat, 30 Aug 2008 11:02:03 -0700 (PDT), Sean Davis wrote: > What is the "best practice" for importing an arbitrary module given > that the name is stored in a variable? The context is a simple web > application with URL dispatching to a module and function. I know of > __import__(), the imp mod

Importing module with name given as a variable

2008-08-30 Thread Sean Davis
What is the "best practice" for importing an arbitrary module given that the name is stored in a variable? The context is a simple web application with URL dispatching to a module and function. I know of __import__(), the imp module, and exec. For each of these, is there a way to make them work