I run this code in VC++:

#include <Python.h>
#include <string.h>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
        Py_Initialize();

        const char* filename = "asdf.py";

        const char* str = "print('lol')";

        Py_CompileString(str, filename, 0);

        Py_Finalize();
        system("PAUSE");
        return 0;
}

On running, it immediately crashes.

I use PyRun_SimpleString and other high level stuff from the API with
no problem, but Py_CompileString is not working. I'm probably using it
wrong.

Any help is appreciated.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to