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(不怎么用)