Tutorial by Examples

Start from a Cython program with a entrypoint: def do_stuff(): cdef int a,b,c a = 1 b = 2 c = 3 print("Hello World!") print([a,b,c]) input("Press Enter to continue.") Create a setup.py file in the same folder: from distutils.core import set...
For automation of the above procedure in Windows use a .bat of the similar contents: del "main.exe" python setup.py build_ext --inplace del "*.c" rmdir /s /q ".\build" pyinstaller --onefile "main.py" copy /y ".\dist\main.exe" ".\main.exe&q...
To add Numpy to the bundle, modify the setup.py with include_dirs keyword and necessary import the numpy in the wrapper Python script to notify Pyinstaller. program.pyx: import numpy as np cimport numpy as np def do_stuff(): print("Hello World!") cdef int n n = 2 ...

Page 1 of 1