Failing in a simple embedding example of python

Themistoklis Bourdenas burdenas at csd.uoc.gr
Wed Mar 1 03:46:44 EST 2006


Hi I'm trying the following simple test in my application:

        FILE* fp = fopen("test.py", "r");
        PyRun_SimpleFile(fp, "test.py");
        fclose(fp);


However I get seg fault is in PyRun_SimpleFile(fp, "test.py"). "test.py" 
is an existing file with a simple statement (print 7+4).
When I try PyRun_SimpleString("..."); The script is running normally. 
What is the problem with this one?
I don't know if this cause any trouble but I link statically with python.

Thank you.



More information about the Python-list mailing list