PyRun_File crash my application

Bing Chen BC at prism.co.nz
Sun Dec 5 18:07:33 EST 1999


Hi, all
I try to embed PyRun_File in my application. It crashed. Anybody know what's
happen. How can I run a file in Python interpreter? My code as follows:
  FILE * fp = fopen( py_token, "r" ); #py_token is a file name
  PyObject *module = PyImport_AddModule("__main__");
  PyObject *dict   = PyModule_GetDict(module);
 PyRun_File( fp, py_token,Py_file_input, dict, dict );

Many thanks
BC







More information about the Python-list mailing list