calling a function from string

james_027 cai.haibin at gmail.com
Mon Oct 22 10:54:02 CEST 2007


hi,

i have a function that I could like to call, but to make it more
dynamic I am constructing a string first that could equivalent to the
name of the function I wish to call. how could I do that? the string
could might include name of the module.

for example

a_string = 'datetime.' + 'today()'

how could I call a_string as function?

Thanks
james




More information about the Python-list mailing list