Calling python from a c++ program for distribution

前端 未结 6 2244
北海茫月
北海茫月 2020-11-28 02:47

I would like to call python script files from my c++ program.

I am not sure that the people I will distribute to will have python installed.

Basically I\'m

6条回答
  •  清歌不尽
    2020-11-28 02:53

    Use system call to run a python script from C++

    #include
    #include 
    using namespace std;
    int main ()
    {
    int result = system("/usr/bin/python3 testGen1.py 1");
    cout << result; 
    }
    

提交回复
热议问题