Given a string - execute a function by the same name

marek.rocki at wp.pl marek.rocki at wp.pl
Mon Apr 28 18:45:39 CEST 2008


One solution may be to use globals():

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

Regards,
Marek



More information about the Python-list mailing list