[TOC]
环境配置VS Studio
c_cpp_properties.json
1 | { |
tasks.json
1 | { |
0. Test Run
1 |
|
1. C++传参
call python method, set parameter ,return value
常用的有两种方法:
1 | 使用 PyTuple_New 创建元组, PyTuple_SetItem 设置元组值 |

1 | int demo1() |
2.传递List参数
1 | int demo2() |
3 python类操作,类属性,类成员函数 Todo
1 | int demo3() |
4 传递c++数组转python的list
1 | int demo4(){ |
参考:
https://docs.python.org/2/extending/embedding.html
https://wenku.baidu.com/view/01fab1346f175f0e7cd184254b35eefdc8d315cd.html
https://numpy.org/doc/1.17/reference/c-api.array.html
https://numpy.org/doc/1.17/reference/c-api.array.html#importing-the-api