This seems to be sort of what I want, except I want to make an instance of a C PyObject in another C module.
Create instance of a python class , declared in python, with C API
But I am not able to find the documentation for using a Python module from C. I can't seem to find the relevent docs online as everyone just talks about extending Python with C.
My issue is that I have a Pygame which I want to speed up. So I am making a C module which needs access to Pygame. How do I import pygame? I don't want to import two copies, right? The coding part I can figure out, I just don't know how to configure and link the code. I know I must be missing some docs, so if anyone can point me in the right direction, I'd be much obliged.
Update: Sorry I reread my post and realized my wording was terrible.
If you have pygame installed you can look in your Python/include directory and find pygame header files. What are they for? I thought that your C module could access the pygame C module directly, so that your python script AND your C module used the same pygame instance.
Clarification anyone?