Given a string - execute a function by the same name

marek.rocki at wp.pl marek.rocki at wp.pl
Mon Apr 28 12:45:39 EDT 2008


One solution may be to use globals():

>>> globals()['foo']()

Regards,
Marek



More information about the Python-list mailing list