Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 352 Bytes

File metadata and controls

21 lines (15 loc) · 352 Bytes

Python3 to Linux binary compile

Require cPython and GCC

Параметр запуска:

compile_py.sh example.py

#/bin/bash

f=$(echo "$1" | cut -f 1 -d '.')
cp $1 $f.pyx
cython $f.pyx --embed -3
gcc -Os -I /usr/include/python3.9 -o $f $f.c -lpython3.9 -lpthread -lm -lutil -ldl -O3
rm -rf $f.pyx $f.c