我想知道是否有辦法打印什麼功能定義?有沒有辦法在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