基本上我想有一个元组/列表,其中包含 python 中不同数据类型的值(float/int/bool/char/list)的字典。
我从以下代码中得到这个:
(<f_p.Bunch; proxy of <Swig Object of type 'Bunch *' at 0x7f4954bdde10> >, <f_p.Bunch; proxy of <Swig Object of type 'Bunch *' at 0x7f4954bdde40> >, <f_p.Bunch; proxy of <Swig Object of type 'Bunch
*' at 0x7f495668be70> >, <f_p.Bunch; proxy of <Swig Object of type 'Bunch *' at 0x7f4952d09a50> >)
Run Code Online (Sandbox Code Playgroud)
我想以这种形式获得输出:
({'I':1.0,'B':2.0,'C':3.0,'dert_':[1.2, 2.3, 3.4, 4.5, 5.6]})
我无法处理此类对象指针 (bunch*),也找不到任何解决方案。我在网上查看,但找不到适合我的案例的有效解决方案。
f_p.cpp:
#include <iostream>
#include "f_p.h"
#define CPP_14 0
std::vector<Bunch*> form_p(const double *array, int x, int y) {
std::vector<Bunch*> v;
Bunch …Run Code Online (Sandbox Code Playgroud)