Calling function

Mark McEahern marklists at mceahern.com
Tue Feb 25 09:34:26 EST 2003


[Dominik Kotowicz]
> mainprog.py :
> 
> import module1
> 
> function_name = raw_input()
> 
> #and here I type: 'foo' and I would like call this functionwith

Here ya go:

  functionwith = getattr(module1, function_name)

// m
-






More information about the Python-list mailing list