How do callbacks work?

By | April 14, 2017

Confused about how callbacks work? Check out this really neat example.

def say_hello(value, callback):
print value
callback()

def say_name():
print “Fra”

say_hello(“ciao”, say_name)

Ref: https://bytesforlunch.wordpress.com/2012/03/15/simple-callback-implementation-in-python/

Leave a Reply

Your email address will not be published. Required fields are marked *