<分区> 分区>
Possible Duplicate:
How to pass arguments to the __code__ of a function?
我有一个代表函数的代码对象。当我在代码对象上调用 exec 时,如何为输入参数 p 指定一个值?
def x(p):
print p
code_obj = x.__code__
exec code_obj
#TypeError: x() takes exactly 1 argument (0 given)
