programmatically calling a function

Dave Ekhaus dekhaus at mac.com
Fri Mar 4 21:25:05 EST 2005


hi

	i'd like to call a python function programmatically - when all i have 
is the functions name as a string.  i.e.

	
fnames = ['foo', 'bar']

for func in fnames:

	#
	# how do i call function 'func' when all i have is the name of the 
function ???
	#
	


def foo():
	
	print 'foo'

def bar():

	print 'bar'


	i'd really appreciate any help the 'group' has to offer.


thanks
dave




More information about the Python-list mailing list