如何通过Python C api在QT和Python之间进行接口
How to interface between QT with Python by Python C api
我正在编写一个与python接口的Qt程序。我必须将Circle类的C++对象直接发送到Python
1) Need to create a Python Module ( let say Shape )
2) Need to add a Python Class PCircle in Shape module which is equivalent to C++
Circle class.
3) Do the calculation on Python Environment ( Python 3.4)
4) Populate the data into PCircle Object in Python
5) Send it back to Qt Environment by storing the PCircle values to C++ Circle Object
and show the changes in real time in display
这就是我如何描述我的问题以及我的目标,如果有什么不清楚的地方,请评论。
感谢
- 模块只是一个python文件。。。所以只需创建一个名为Shape.py的文件
- 打开Shape.py并添加
代码
from PyQt4 import QWidget
class PCircle(QWidget):
#implement methods here that are available to the QTCircleWidget
- 在python中进行某种计算
代码
def calculation(something):
return somthing**2
- 只需添加代码
my_circle = PCircle(x,y,radius)
- 打印出要返回给调用程序的任何数据。调用程序将需要解析该数据并对其进行处理
相关文章:
- Tensorflow对象检测在Python和C++(OpenCV)之间有不同的结果
- 在 Python 和 c++ 2d 数组初始化之间.这是怎麽?为什么呢?
- 从预序遍历构造 bst 的 c++ 和 python 解决方案之间的区别
- 在C++和Python之间交换数据的最快方法是什么?
- C++和Python之间平等含义的区别的根源是什么?
- 加密 和Python之间的Diffie-Hellman密钥交换
- 通过插座在C 和Python之间进行固定的浮点阵列
- 为什么ZeroMQ req rep在C++和Python之间给我一个空响应
- 在C/C++和Python之间共享内存
- 支持C和Python之间的跨语言(C)标签的代码编辑器
- C++和Python之间的数据损坏管道
- Arduino SHA1-HMAC 和 base64 编码与 Python 之间的问题
- C++与Python之间的通信(IPC)
- C++应用程序(Sci)Python之间的数据交换
- 如何通过Python C api在QT和Python之间进行接口
- 在c++和Python之间切换控制的代价
- c++和Python之间的通信
- 在Visual c++和Python之间交换数据
- c++和Python之间的简单IPC(跨平台)
- 这是c++和Python之间CPU时间比较的有效方法吗?