C和Python的接口

2024-05-15 14:23:39 发布

您现在位置:Python中文网/ 问答频道 /正文

Possible Duplicate:
Calling C/C++ from python?

<>我想桥接C++和python代码。在

python需要接口:

floatvect(): this one should return an empty float vector (basically a list)

get_quant(input_list_2, self.m_state_num, self.m_qm_vector)

<> P>相应的C++函数为:

int equalwidth_quant(int target_num_state, FloatVec &raw_data, FloatVec &init_quant)

当我的Python代码与GETQuQuin接触时,它应该能够调用相应的C++函数并得到结果。结果基本上存储在C++函数的最后一个属性中。在

有没有什么特定的库可以用来实现这一点?在


Tags: 函数代码fromselfnumlistintstate