- convert .py to .pyx
- use cython to convert .pyx to .c
- compile .c
- Test run
example python file:
script.py
you can copy or rename both i am copying
cp script.py script.pyx
cython script.pyx --embed
gcc -Os -I /usr/include/python3.8 -o script script.c -lpython3.8 -lpthread -lm -lutil -ldl
./script
and done.