偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Python嵌入c中時(shí)應(yīng)該鏈接的庫有哪些

開發(fā) 后端
在計(jì)算機(jī)的實(shí)際的操作中庫這一詞是否耳熟能詳?以下的文章就是對(duì)把Python嵌入c中時(shí)應(yīng)該鏈接的庫的相關(guān)介紹,希望你會(huì)從中得到自己想要的東西。

如果你對(duì)把Python嵌入c中時(shí)應(yīng)該鏈接時(shí)有哪些庫可以對(duì)其進(jìn)行連接時(shí),你就可以點(diǎn)擊我們的文章進(jìn)行觀看,對(duì)把Python嵌入c中時(shí)應(yīng)該鏈接的庫有所了解,以下是文章的具體介紹,望你會(huì)有所啊后或。

  1. //------------------------------------------   
  2. //cppobj.h   
  3. //   
  4. #include <iostream>   
  5. using namespace std;   
  6. class cppobj {   
  7. private :   
  8. string s;   
  9. public :   
  10. cppobj(string a): s(a) {};   
  11. string show() {return s;}   
  12. };   
  13. //-----------------------------------------   
  14. //------------------------------------------   
  15. //cppobj.i   
  16. %module cppobj   
  17. %include "std_string.i"   
  18. %{   
  19. #include "cppobj.h"   
  20. %}   
  21. %include "cppobj.h"   
  22. //------------------------------------------   
  23. //------------------------------------------   
  24. // Makefile   
  25. _cppobj.so: cppobj_wrap.o   
  26. g++ -o $@ $< -shared -fpic -lpython24   
  27. cppobj_wrap.cxx: cppobj.i cppobj.h   
  28. swig -c++ -python cppobj.i   
  29. cppobj_wrap.o: cppobj.h cppobj_wrap.cxx   
  30. g++ -c cppobj_wrap.cxx -fpic -IC:/Python24/include   
  31. clean:   
  32. rm -rf cppobj_wrap.cxx _cppobj.so *.o cppobj.py cppobj.pyc   
  33. //------------------------------------------   

把Python嵌入c中時(shí)應(yīng)該鏈接庫的相關(guān)代碼的前部分介紹做完之后還要

  1. $ mv _cppobj.so _cppobj.pyd  

然后就可以

  1. >>> from cppobj import cppobj   
  2. >>> c = cppobj('Hello')   
  3. >>> c.show()   
  4. 'Hello'  

很久以前記的筆記,希望能幫上忙Top以上就是對(duì)把Python嵌入c中時(shí)應(yīng)該鏈接庫的相關(guān)代碼的介紹,望你會(huì)有所收獲。

【編輯推薦】

  1. 把Python嵌入C/C++元組操作的具體以應(yīng)用方案介紹
  2. Python嵌入C/C++(較低層次嵌入)時(shí)所需用到的函數(shù)
  3. Python嵌入C/C++會(huì)產(chǎn)生的強(qiáng)大功能的介紹
  4. Python嵌入C++來彌補(bǔ)C++本身不足之處的方案介紹
  5. 用Python連接PostgreSQL數(shù)據(jù)庫所需版本的介紹
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2010-06-09 10:20:56

鏈接MySQL數(shù)據(jù)庫

2010-03-26 10:19:31

Python嵌入CC++

2025-02-13 09:26:43

Python元組集合

2011-05-18 17:15:45

2010-03-24 12:45:00

Python 嵌入

2010-03-16 15:38:57

Python串口

2010-03-16 15:38:57

Python串口

2011-05-26 16:52:33

2025-05-23 08:15:00

C++constexpr字面類型

2024-01-11 12:13:29

云監(jiān)控網(wǎng)絡(luò)云計(jì)算

2010-04-21 14:11:56

Oracle數(shù)據(jù)庫

2020-06-11 08:39:55

數(shù)據(jù)庫存儲(chǔ)技術(shù)

2020-02-11 09:41:02

Go語言程序員文章

2020-02-05 16:55:11

Go語言程序員文章

2022-04-18 12:29:18

C++

2021-06-18 08:15:37

Linux軟鏈接硬鏈接

2020-03-03 09:28:30

Python內(nèi)存開發(fā)

2010-06-12 10:49:12

2010-08-09 13:08:45

DB2數(shù)據(jù)庫

2025-01-27 12:19:51

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)