#include #include int main(int argc, char **argv) { Py_Initialize(); //PySys_SetArgvEx(argc, argv, 0); PyObject *sh_mod = PyImport_ImportModule("shutil"); printf("sh=%p\n", sh_mod); printf("before %d\n", (int)Py_REFCNT(sh_mod)); Py_Main(argc, argv); printf("after %d\n", (int)Py_REFCNT(sh_mod)); Py_Finalize(); return 0; }