Turn string into function call

Paul Rubin phr-n2002a at nightsong.com
Fri Mar 8 09:08:15 EST 2002


nbecker at fred.net (N Becker) writes:

> What's the best way to turn a string naming a function into a function call?
> 
> I used this:
> eval (funcname + '()')

vars()[funcname]() might be a little safer.



More information about the Python-list mailing list