Need to import stuff

Jerry Hill malaclypse2 at
Wed Aug 18 00:27:39 CEST 2010

On Tue, Aug 17, 2010 at 6:21 PM, abhijeet thatte
<abhijeet.thatte at> wrote:
> Hi,
> I need to import few files depending on the user input. For eg if user gives
> an input as "abcd" then I will have  import "".
> Can not have any hard coding in the code. Does any one know how to solve the
> problem.

Use the __import__ function ( ), like this:

user_module = __import__("abdc")


More information about the Python-list mailing list