作者Freak1033 (金が信念! XD)
看板Python
标题Re: 请问如何在自订dll模组当中expose一个变数..
时间Fri Jun 16 17:38:26 2006
※ 引述《yoco315 (眠月)》之铭言:
: 在 Extending & Embedding 的文件里面
: 有教怎麽在模组当中建立 function, class, type 等等..
: 但是没有讲怎麽在当中建议一个新的 '变数'..
: 请问应该如何完成这个动作?
http://docs.python.org/api/moduleObjects.html#l2h-680
int PyModule_AddObject( PyObject *module, char *name, PyObject *value)
Add an object to module as name. This is a convenience function which
can be used from the module's initialization function. This steals a
reference to value. Return -1 on error, 0 on success. New in version 2.0.
int PyModule_AddIntConstant( PyObject *module, char *name, long value)
Add an integer constant to module as name. This convenience function
can be used from the module's initialization function. Return -1 on
error, 0 on success. New in version 2.0.
int PyModule_AddStringConstant( PyObject *module, char *name, char *value)
Add a string constant to module as name. This convenience function can
be used from the module's initialization function. The string value must
be null-terminated. Return -1 on error, 0 on success. New in version 2.0.
--
その乾いた哀愁の瞳に去来するものは何か?
失ったもの 得たもの
そして广大なネットの狭间で彼が见たものとは?
虚像と实存と记号の中に彼は今、何を想うのか?
<バトルプログラマーシラセ>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.109.224.64
1F:推 yoco315:非常感谢 :D 06/17 23:46