File: class/Workbook/Examples/Lecture5/indirect.py

def echo(message): print message
x = echo
x('Hello world!')

def indirect(func, arg):
    func(arg)
indirect(echo, 'Hello world!')

schedule = [ (echo, 'Hello!'), (echo, 'Ni!') ]
for (func, arg) in schedule:
    apply(func, arg)



[Home page] Books Code Blog Python Author Train Find ©M.Lutz