En Fri, 20 Jul 2007 12:48:05 -0300, Prepscius, Colin (IT)
<[EMAIL PROTECTED]> escribió:
> Does anybody know how to pass parameters to 'exec
> somefunction.func_code'?
> def f1():
> print 'this is f1'
> def f2(p):
> print 'this is f2, p =', str(p)
> exec f1.func_code
> THIS RESULTS IN: "
Does anybody know how to pass parameters to 'exec
somefunction.func_code'?
def f1():
print 'this is f1'
def f2(p):
print 'this is f2, p =', str(p)
exec f1.func_code
THIS RESULTS IN: "this is nf1" WHICH IS NICE
exec f2.func_code
THIS RESULTS IN: TypeError: f2() takes exactly 1 ar