Problem embedding Python.

Brandon Keown keown.brandon at
Tue Oct 27 11:04:55 CET 2009

I found the problem.  Evidently as posted on a few other areas of the
internet, this is a common problem when trying to use compilers that
may have different type definitions for (FILE*).  Here is workable

#include <Python.h>

int main(int argc, char* argv[])
	PyObject* PyFileObject;
	char* filename;
	filename = "c:\\Patches\\Test\\Debug\\";
	PyFileObject = PyFile_FromString(filename, "r");
	PyRun_SimpleFile(PyFile_AsFile(PyFileObject), filename);
	return 0;

More information about the Python-list mailing list