python查看源代码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_16570607/article/details/79062777

python查看源代码

首先要查找到源码的位置,可以使用以下命令行:

>>> import string
>>> string.__file__
'/usr/lib/python2.7/string.pyc'
>>>

对应目录下的string.py就是package的源码,不过有些库因为是c写的,会提示错误,这样的库就需要下载python源码,直接看c的源文件。

猜你喜欢

转载自blog.csdn.net/qq_16570607/article/details/79062777
今日推荐