Calling functions in a loop

Alex new_name at mit.edu
Sat Jul 14 13:35:21 EDT 2001


After defining the functions, you may be better off defining 

__all__ = [Fn1, Fn2]

Then the code as you have it will work.

If you really want it to work with the names of the functions in
strings, try something like

for Fn_name in __all__: eval(Fn_name)()

HTH.
Alex.



More information about the Python-list mailing list