Re: exec and CodeObjects

2007-07-20 Thread Gabriel Genellina
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: "

exec and CodeObjects

2007-07-20 Thread Prepscius, Colin (IT)
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