calling a function indirectly
grante at visi.com
Wed Feb 20 05:30:15 CET 2002
In article <a4v7s6$13tk at r02n01.cac.psu.edu>, Rajarshi Guha wrote:
> is it possible to have a variable contain a function name, and use the
> variable to call the function?
> An example:
> def func:
> some code
> funcvar = 'func'
> Now use funcvar (somehow!) to call func
How about this:
x = func
It doesn't use the name of the function, but if you really want
to do it that way you can do this:
x = "func"
Grant Edwards grante Yow! I want a VEGETARIAN
at BURRITO to go... with
visi.com EXTRA MSG!!
More information about the Python-list