Use Python in C -
i need use features available in python program written in c. found several sources me one of them gives me command compile code:
gcc -i/usr/include/python2.7 prog.c -lpython2.7 -o prog -wall && ./prog
i had change
gcc -i/usr/include/python3.4 prog.c -lpython3.4 -o prog -wall && ./prog
but compiler returns:
/usr/bin/ld: cannot find -lpython3.4 collect2: error: ld returned 1 exit status
it's 1 of first times have used gcc
don't understand when @ examples.
have tried interface c , python using cython?
the manual can found here: https://python.g-node.org/python-summerschool-2011/_media/materials/cython/cython-slides.pdf
in section 4.10 talks briefly interfacing python , c. thoughts call c code cython, way have complete , direct access python features want use.
here's more on interfacing external c code:
http://cython-docs2.readthedocs.io/en/latest/src/userguide/external_c_code.html
Comments
Post a Comment