【发布时间】:2011-05-08 07:02:42
【问题描述】:
Python 文档很好地介绍了Extending and Embedding Python with C\C++。但是,在许多情况下,需要在语言之间传输复杂的数据结构。
实现这一目标的最佳方法是什么?
【问题讨论】:
标签: c++ data-structures extending python-embedding
Python 文档很好地介绍了Extending and Embedding Python with C\C++。但是,在许多情况下,需要在语言之间传输复杂的数据结构。
实现这一目标的最佳方法是什么?
【问题讨论】:
标签: c++ data-structures extending python-embedding
Create your own type 并适当填写tp_*attr 成员。
【讨论】:
tp_*attr 函数来回转换数据。
IIRC Boost.Python http://www.boost.org/doc/libs/1_54_0/libs/python/doc/index.html 将在这里为您完成很多繁重的工作。
【讨论】: