HA! After much experimenting I hit upon getattr(__import__(page), page):

for page in self.allowedPages:
   scriptPath = '{}/{}.py'.format(os.path.dirname(__file__), page)
   if os.path.exists(scriptPath):
      self.modules[page] = getattr(__import__(page), page)


Then in __call_ I just say:

target = incoming CGI variable
self.modules[target](qList, environ)

and it works!

-- Gnarlie
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to