-
pyx
PYX file is a Pyrex source.
Pyrex is a Language for Writing Python Extension modules.
Pyrex lets you write code that mixes Python and C data types any way you want, and compiles it into a C extension for Python.
.pyx
文件是由Cython
编程语言 “编写” 而成的Python
扩展模块源代码文件。.pyx
文件类似于 C 语言的.c
源代码文件,.pyx
文件中有Cython
模块的源代码。不像
Python
语言可直接解释使用的.py
文件,.pyx
文件必须先被编译成.c
文件,再编译成.pyd
(Windows
平台) 或.so
(Linux
平台) 文件,才可作为模块import
导入使用。 -
pyx相关扩展
.py Python Script
.pym Python Macro File
.pyc Python Bytecode
.pyd Python Dynamic Module
.pyo Python Optimized Code
.tcl TCL Script
.pxd Pyrex Definition File
.pyr Python Repository
.pth Python Path Configuration
.pxi Pyrex Include File
-
如何创建pyx文件
-
pyd
.pyd
文件是非Python
,由其它编程语言 “编写-编译” 生成的Python
扩展模块。.pyd
是二进制文件,只能反编译查看,本质上就是DLL
文件。Python
要导入.pyd
文件,实际上是在.pyd
文件中封装了一个module
。在python
中使用时,把它当成module
来用就可以了,即:"import 路径名.modulename"
即可,路径名为.pyd
文件所在的路径。 -
References
Python中.pyx与.pyd
最新推荐文章于 2024-04-03 16:10:41 发布