Created
September 19, 2014 05:31
-
-
Save somma/69c15c0f7043d4fc696d to your computer and use it in GitHub Desktop.
callback function in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3.2 | |
def repeat (function, params, times): | |
for calls in range (times): | |
function (*params) | |
def foo (a, b): | |
print ('{} are {}'.format (a, b) ) | |
repeat (foo, ['roses', 'red'], 4) | |
repeat (foo, ['violets', 'blue'], 4) | |
http://stackoverflow.com/questions/13783211/python-how-to-pass-an-argument-to-a-function-pointer-parameter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment