Run .py script from C++

Kos*_*avt 0 c++ python lua

My question:

How to call a python script from C++?

Context:

I have such line written in Lua language:

os.execute("C:\\InstallPython\\python.exe C:\\FINAM\\py+lua\\Finam_parser.py")
Run Code Online (Sandbox Code Playgroud)

It runs a python script from my Lua script. Now, I want to transfer this script from Lua to C++. Please, help me to write the same thing using C++ language and to include the proper libraries.

Jos*_*ica 5

Put #include <cstdlib> at the top of your program, then put system("C:\\InstallPython\\python.exe C:\\FINAM\\py+lua\\Finam_parser.py"); wherever you want it to run.

请注意,这是对操作的完全字面翻译os.execute,并且可能可以重组程序以使用更简洁的替代方法。