Mega Code Archive

 
Categories / Python Tutorial / Function
 

Stuff function objects into data structures

def echo(message):                       print message  schedule = [ (echo, 'Spam!'), (echo, 'Ham!') ] for (func, arg) in schedule:     func(arg)