How to run a Python file in c++? -


I am trying to run a python file from C ++, a good part of my day. I have tried:

 . . FILE * file = fopen ("file.py", "r"); PyRun_SimpleFile (file, "file.py"); . . .  

This only causes crashes of my application. I'm using Python version 3.4.

Try

  Py_Initialize (); PyRun_SimpleFile (file, "file.py"); Py_Finalize ();  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -