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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -