import question

kopfarzt at kopfarzt at
Fri Nov 3 12:01:07 CET 2000


how can I dynamically import modules in function
a() , and then call them by name in function b()
instead of using the module object?

what I want to do is something like this:

def a():
  module = __import__ ('foo')

def b():
  x = eval (' ()')

I always get a NameError: foo
(I am using Python 1.5.2)

Thanks in advance for any replies!

Sent via
Before you buy.

More information about the Python-list mailing list