简体   繁体   English

如何查看python模块? 它们是.so文件,PyCharm无法识别如何打开它们

[英]How do I view python modules? They are .so files and PyCharm does not recognize how to open them

I want to read how some of the modules work. 我想阅读一些模块的工作原理。 I thought they would be .py files which could teach me the inner workings of then. 我以为它们是.py文件,可以教我那时的内部工作原理。 However when I import a module it says it is coming from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/math.cpython-36m-darwin.so 但是,当我导入模块时,它说它来自/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/math.cpython-36m-darwin.so

I went to the lib-dynload folder under external libraries in PyCharm but these module files are all '.so' files. 我去了PyCharm外部库下的lib-dynload文件夹,但是这些模块文件都是'.so'文件。

What is a .so file? 什么是.so文件?

How can I view a .so file and learn about the code within it? 如何查看.so文件并了解其中的代码?

If it isn't obvious I am very new to python so please be descriptive with your answer. 如果不是很明显,我对python还是很陌生,所以请用您的答案描述一下。

.so files are native shared libraries. .so文件是本机共享库。 They are written in C rather than Python. 它们是用C而不是Python编写的。 If you're curious about them, you can look at Python's source code . 如果您对它们感到好奇,可以查看Python的源代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM