Problems embedding Python

Psymaster nosmapplease at somewhere.com
Sat Jan 31 18:25:51 EST 2004


I've tried running scripts from the embedded interpreter but it doesn't 
work. If I try the same scripts as strings to interpret it works. Here 
is my program:

#include <stdio.h>
#include "Python.h"

int main(int argc, char *argv[])
{
  FILE *script = fopen("c:/c.py", "r");

  Py_Initialize();  
  PyRun_SimpleFile(script, "c.py");
  Py_Finalize();

  return 0;
}


c.py contains just a simple print statement.

This compiles and links under MSVC 6 but when run crashes. Any help?



More information about the Python-list mailing list