Source Code Cython Logo Source Code Cython 2023 v5.5.0.2 build 20231206.083049

 

This applet is suitable for IT Programmer by comparing source code backup (or setting conditions) to some .PXD .PY .PYW .PYX files in the specified directory quickly convert and compile into the .PYD file based on C programming language .

支持以多进程、多线程模式,快速编译指定源代码文件并生成 *.PYD 动态库。

Related Application


Digital C/C++ IDE     Digital Python IDE

Source Code PyInstaller      Source Code Dython

Basic Usage


Cython documentation, the quick start tutorial is here.

Support to generate .PYD files and move them to the corresponding source code directory; .PY source code has some efficiency improvements after Cython, it's not obvious but it can be felt.

Cython will first convert .PXD .PY .PYW .PYX file into .C intermediate code, then compiled into the .PYD module file; therefore, decompiling .PYD file can only get .C intermediate code (the original source code could not be obtained).

Depends on the version of Python interpreter used when compiling, automatic correct *.C intermediate code document 2.7 3.x language level; However, must write the setup.py compilation configuration file in strict accordance with the specified code form.

If there is no response for a long time after the *.C file is generated, please check the installed Visual Studio Build Tools for C/C++ version (compatible with 2017 and earlier versions) or configuration is correct or not.

If the Microsoft Visual C/C++ compiler is not installed or the configuration is incorrect when compiling, the prompt (including link address) dialog for installing the Visual C/C++ compiler will pop up.

If you use external or custom modules, please add the corresponding path to Console Config dialog PATH variable box.

If there is a problem with the source code during transcoding, the source code error summary prompt dialog will pop up.

Use Skill

若重命名 *.PYD 文件后,启动时提示 ImportError: dynamic module does not define module export function (PyInit_xx),请重新 Cython 相关模块。

Python3.x

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
 
__version__ = "0.1.7.1 build 20200301.060127" # With Full Text Replace applet to batch modify, check the file version checkbox will automatically update
 
from distutils.core import setup
from Cython.Build import cythonize
 
#Below code layout forms must be strictly followed
modules = [
    "base.py",
    "text.py"] #Usually only modify the name of the module to be compiled here,__init__.py does not support compilation
setup(
    ext_modules=cythonize(modules),
)
			

Python2.7

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
 
__version__ = "0.1.7.1 build 20200301.060127" # With Full Text Replace applet to batch modify, check the file version checkbox will automatically update
 
from distutils.core import setup
from Cython.Build import cythonize
 
#Below code layout forms must be strictly followed
modules = [
    "base.py",
    "text.py"] #Usually only modify the name of the module to be compiled here,__init__.py does not support compilation
setup(
    ext_modules=cythonize(modules),
)
			

Fit Format

Usage Scene File Format Usage Scene File Format
Python Programming Language .py .pyw Cython Programming Language .pxd .pyx

What specific formats are supported, subject to the release version.