如果你的.py文件与C/c++程序在同一目录
python的默认搜索路径中不包括./(即当前目录),在C程序中加入下面两条语句就:
PyRun_SimpleString("import sys");
PyRun_SimpleString("sys.path.append('./')");
包含头文件:#include <python2.6/Python.h>
编译:gcc -o app python.c -L/usr/lib/python2.6/config -lpython2.6