将C ++转换为Python [英] Converting C++ to Python
本文介绍了将C ++转换为Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在尝试使用kinect制作虚拟更衣室应用程序。我的问题是我想使用poser进行建模,所以我需要将C ++从kinect转换为python。我没有python的经验!
有人可以帮帮我吗?
Hello,
I'm trying to make a virtual dressing room application with kinect. My problem is that I want to use poser for modeling, so I need to convert C++ from kinect to python. I have no experience in python!
Can anybody help me please?
推荐答案
我不知道什么是kinect,但我经常使用C ++ / Python绑定。有一个名为swig的工具,它是一种广泛使用的方法,用于将C ++导出到Python(以及其他组合)。基本上,您创建了传递给Swig(一个独立应用程序)的接口文件(* .i),它生成可以用Python导入的对象/库。这可能有点痛苦,但它有效并且有很多人使用它,所以如果你遇到问题,那里有一些帮助。
< a href =http://www.swig.org/index.php>简化的包装器和接口生成器 [ ^ ]
I have no clue what "kinect" is but I do work with C++/Python binding often. There's a tool called "swig" that's a widely used method for exporting C++ to Python (and other combinations). Essentially you create interface files (*.i) that you pass to Swig (a standalone app) that generates objects/libraries that can be imported in Python. It can be a bit of a pain but it works and there are plenty of people using it so if you run into problems, there is some help out there.
Simplified Wrapper and Interface Generator[^]
class stack {
public:
int empty(stack* s );
void pop(stack *, int * ,int * underflow);
void push(stack *,int * ,int * overflow);
int menu();
int myTop;
int data[300];
};
这篇关于将C ++转换为Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文