python modules difference: .c/.h vs. .py
Posted
by
bijan
on Stack Overflow
See other posts from Stack Overflow
or by bijan
Published on 2012-10-23T22:58:03Z
Indexed on
2012/10/23
23:00 UTC
Read the original article
Hit count: 391
python
|python-2.7
I'm very new to python, as i'm embedding it (in form of a static lib) in an ios project. It's not possible for me to dynamically load python modules, so i would like to compile my modules along with python.
For modules shipped with the python source this works (by modifying setup.py
or Module/Setup
), but when i downloaded a third party module i noticed, i don't fully understand the mechanism.
The modules shipped with python come with a .c
file in the Modules
dir as well as a .py
file in the Lib
dir.
My third party module just comes with .py
files.
1.Why do those modules have different file extensions?
2.How to integrate a module coming with .py files in an embedded python version? Obviously pasting them in Modules/Setup does require some .c
files.
3.Do these .c files have something to do with the Python C-Api?
I guess i'm missing something essential :) Help is much appreciated.
© Stack Overflow or respective owner