我想知道是否有办法打印什么功能定义?有没有办法在Python中打印函数的定义
所以如果我想要做的事,如:
def hello():
print 'hello'
some_function_to_show_definition(hello())
和输出应该是:
print 'hello'
就乱搞的蟒蛇,我只是想知道:)
我想知道是否有办法打印什么功能定义?有没有办法在Python中打印函数的定义
所以如果我想要做的事,如:
def hello():
print 'hello'
some_function_to_show_definition(hello())
和输出应该是:
print 'hello'
就乱搞的蟒蛇,我只是想知道:)
你可能想检查[https://github.com/ipython/ipython/blob/313df3800a05f4ef72fb7bf4509ed699926cb1b2/IPython/core/oinspect.py] – user3570335