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.
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,并且可能可以重组程序以使用更简洁的替代方法。
| 归档时间: |
|
| 查看次数: |
58 次 |
| 最近记录: |