【Python学习】 - 使用Anaconda的Spyder查看某些函数的原型的6种方法汇总
1.Ctrl+鼠标点击函数名(对应的函数名会加下划线) 或 Ctrl+g2.help(function)在某些情况下方法1失效,比如TensorFlow中的一些函数tf.constant,他只会跳转到一个init文件,并不会展示函数原型。所以可以这样help(tf.constant),就可以3.使用inspect包import inspect as ist...
·
1.Ctrl+鼠标点击函数名(对应的函数名会加下划线) 或 Ctrl+g
![]()
2.help(function)
在某些情况下方法1失效,比如TensorFlow中的一些函数tf.constant,他只会跳转到一个init文件,并不会展示函数原型。
所以可以这样help(tf.constant),就可以

3.使用inspect包
import inspect as ist
print(ist.getsource(tf.constant))

4. 直接在函数后面+ .__doc__即可
5. dir(...) 可查看对应函数或变量的所有属性
6. 直接在函数前或者函数中按Ctrl+I(不怎么用)
更多推荐


所有评论(0)