Created
July 25, 2009 10:26
-
-
Save boyska/154765 to your computer and use it in GitHub Desktop.
create a function with a custom number of arguments (len of out_string+1)
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
code = 'def _f(inst' | |
for i in range(len(out_string)): | |
code += ', arg%d' % i | |
code += '): pass\n' | |
print code, 'C' | |
exec code in locals() | |
func = _f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment