Roman Suzi <rnd at onego.ru> wrote in comp.lang.python: > I know exec is not very nice, but I am not sure if something > better exists for the following: > > fake, v = {}, {} > exec """from mod_%s import func""" % modname in fake, v > return v["func"](args) module = __import__("mod_"+modname) return getattr(module, "func")(args) -- Remco Gerlich