On Tue, 8 May 2007 09:38:48 +0200, Cesar Härdfeldt wrote
> [...]  
> I now have 'module' and 'function' as strings and 'parms' normally as a list 
> of strings. I can import the module by __import__(module) but is there 
> another way to call:
> module.function(parms) than using eval()?

function_to_call = getattr(__import__(module), function)
function_to_call(parms)

Hope this helps,

--
Carsten Haese
http://informixdb.sourceforge.net

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

Reply via email to