Failing in a simple embedding example of python

  • Thread starter Themistoklis Bourdenas
  • Start date
T

Themistoklis Bourdenas

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top