python相關資料

2021-09-29 14:40:21 字數 1825 閱讀 7688

python文件

//pyinitialize: 必須首先呼叫,初始化python執行所需模組。它無引數、無返回值

void py_initialize();

/*py_isinitialized: 檢查初始化是否成功

*返回值: 成功返回true*/

bool py_isinitialized();

/*pyimport_importmodule: 載入python模組

*szmodulename: 模組名稱

*返回值: 成功載入返回模組指標*/

pyobject *pyimport_importmodule(const char *szmodulename);

/*pymodule_getdict: 獲取模組字典

*pmodule: 模組指標

*返回值: 成功從指定模組獲取字典返回字典指標*/

pyobject *pymodule_getdict(pyobject *pmodule);

/*pydict_getitemstring: 從模組字典中獲取指定的物件

*pdict: 被查詢的模組字典指標

*key: 要查詢的模組中的函式或類名

*返回值: 若找到指定的物件,返回指向它的指標;否則返回null*/

pyobject *pydict_getitemstring(pyobject *pdict, const char *key);

/*pyinstancemethod_new: 例項化從模組字典中查詢到的類

*pclass: 從模組字典中找到的類資訊指標

*返回值: 根據類資訊指標構造該類的例項,並返回它的指標*/

pyobject *pyinstancemethod_new(pyobject *pclass);

/*pyobject_callmethod: 呼叫類方法

*pinstance: 由pyinstancemethod_new返回的類例項

*pmethodname: 被呼叫的類方法名

*pformat: 傳遞給類方法的引數型別格式字串

*...: 傳給類方法的引數

*返回值: 被呼叫類方法的返回值。若被呼叫方法無返回值,則本方法返回null*/

pyobject *pyobject_callmethod(pyobject *pinstance, const char *pmethodname, const char *pformat, ...);

/*pyobject_callfunction: 呼叫模組中的函式

*pfunction: 從模組字典中獲取的模組函式指標

*pformat: 要傳給模組函式的引數型別格式化字串

*...: 傳給模組函式的引數列表

*返回值: 模組函式的返回值;若模組函式無返回值,該方法返回null*/

pyobject *pyobject_callfunction(pyobject *pfunction, const char *pformat, ...);

/*pyarg_parse: 從python返回的資料物件中獲取指定的資料

*pargs: 呼叫python方法得到的返回值

*pformat: 指定獲取什麼型別資料的格式化字串

*...: 儲存獲取資料的指標*/

pyarg_parse(pyobject *pargs, const char *pformat, ...);

//下面這個巨集釋放python api建立的物件,如模組,模組字典,函式,類和類例項等等

py_decref(pobject);

//最後呼叫此方法釋放python模組

py_finalize();

c++呼叫python

Python相關的資料

0.setuptool python相關的資料 密碼 www.gpxz.com 2.python文件 這個也是python,以文件為主的 3.ipython 互動式python 4.pydev的安裝 eclipse外掛程式 jython d android android sdk tools lib...

Python學習相關資料

python開發者門戶 webserver伺服器 tornado python和tornado介紹 tornado原始碼分析之http伺服器篇 多指令碼語言模板引擎資訊 python python實現 直譯器 執行python指令碼的命令程式 python包管理工具 pip 在mac下安裝pip 官...

Python資料相關教程資料整理

適用於我這種對r特別熟悉的 pandas vs data.table 深入對比資料科學工具箱 python和r之爭 r與python利用jupyter協同工作 python for data science cheat sheet for beginners pandas cheat sheet f...