On Mon, 2007-04-30 at 16:19 -0700, kwatch wrote: > [...] > The goal what I want to do is to create a module by 'new' module > and specify that module name in 'from ...' statement. > > ---------------------------------------- > # create a module > import new > foo = new.module('foo') > foo.pi = 3.14159 > foo.x2 = lambda x: 2*x > # specify it in 'from' statement > from foo import pi, x2 # ImportError: No module named foo > ----------------------------------------
Not that this can't be done, but why do you think you have to create this 'foo' module on the fly? What is the actual problem you're trying to solve? -Carsten -- http://mail.python.org/mailman/listinfo/python-list