You can import python modules from C code and call things defined just like you can in python code. It is a little long, but quite possible.
When I want to figure out how to do this, I look at the C API documentation . The module import section will help. You will also need to read how to read the attributes, call functions, etc. that are in the documents.
However, I suspect what you really want to do is call the sdl base library from C. It is a C library and very simple to use with C.
python C,
PyObject *module = 0;
PyObject *result = 0;
PyObject *module_dict = 0;
PyObject *func = 0;
module = PyImport_ImportModule((char *)"pygame");
if (module == 0)
{
PyErr_Print();
log("Couldn't find python module pygame");
goto out;
}
module_dict = PyModule_GetDict(module);
if (module_dict == 0)
{
PyErr_Print();
log("Couldn't find read python module pygame");
goto out;
}
func = PyDict_GetItemString(module_dict, "pygame_function");
if (func == 0)
{
PyErr_Print();
log("Couldn't find pygame.pygame_function");
goto out;
}
result = PyEval_CallObject(func, NULL);
if (result == 0)
{
PyErr_Print();
log("Couldn't run pygame.pygame_function");
goto out;
}
out:;
Py_XDECREF(result);
Py_XDECREF(module);