摘要: # mytest.py class Test: def hello(self): print("this is test class hello function no params return 123") return 123 def myadd(self, x, y): print("this 阅读全文
posted @ 2022-04-02 17:30 十一的杂文录 阅读(185) 评论(0) 推荐(0) 编辑
摘要: # mytest.py def myjoin(a, b): print("num a + str b") return f"{a}=={b}" #include "Python.h" #include <iostream> using namespace std; int main(int argc 阅读全文
posted @ 2022-04-02 17:29 十一的杂文录 阅读(152) 评论(0) 推荐(0) 编辑
摘要: # mytest.py def myadd(a, b): print("this is test python print add function") return a+b #include "Python.h" #include <iostream> using namespace std; i 阅读全文
posted @ 2022-04-02 17:27 十一的杂文录 阅读(95) 评论(0) 推荐(0) 编辑
摘要: # mytest.pydef hello1(): print("this is test python print hello world 1") return "456" #include "Python.h" #include <iostream> using namespace std; in 阅读全文
posted @ 2022-04-02 17:25 十一的杂文录 阅读(501) 评论(0) 推荐(0) 编辑
摘要: # mytest.py def hello(): print("this is test python print hello world") return 123 #include "Python.h" #include <iostream> using namespace std; int ma 阅读全文
posted @ 2022-04-02 17:24 十一的杂文录 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include "Python.h" #include <iostream> using namespace std; int main(int argc, char* argv[]) { Py_Initialize(); if (!Py_IsInitialized()) { cout << "初 阅读全文
posted @ 2022-04-02 17:21 十一的杂文录 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 1.进入到Python安装目录 2.将Python安装目录中的 include 和 libs 文件夹放在 C++项目中 3.设置 附加包含目录 和 附加库目录、附加依赖项(python310_d.lib) *: 如果安装的Python是64位的,注意C++编译环境设置成 x64。不然就安装32位Py 阅读全文
posted @ 2022-04-02 17:19 十一的杂文录 阅读(163) 评论(0) 推荐(0) 编辑