C++: Py_CompileString crash
KillSwitch
gu.yakahughes at gmail.com
Mon Oct 26 13:43:59 EDT 2009
On Oct 26, 10:06 am, Christian Heimes <li... at cheimes.de> wrote:
> KillSwitch wrote:
> > 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.
>
> 0 is wrong here, seehttp://docs.python.org/c-api/veryhigh.html?highlight=py_compilestring...
>
> Christian
Yeah that's what I needed, thank you very much.
More information about the Python-list
mailing list