当前位置:网站首页>Qt混合Python开发技术:Python介绍、混合过程和Demo
Qt混合Python开发技术:Python介绍、混合过程和Demo
2020-11-07 23:13:00 【红模仿_红胖子】
若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/109474663 各位读者,知识无穷而人力有穷,要么改需求,要么找专业人士,要么自己研究 红胖子(红模仿)的博文大全:开发技术集合(包含Qt实用技术、树莓派、三维、OpenCV、OpenGL、ffmpeg、OSG、单片机、软硬结合等等)持续更新中...(点击传送门)
Qt开发专栏:三方库开发技术
<br>
前言
Qt中混合Python开发,可调用Python命令与脚本。
<br>
Python
Python是一种跨平台的计算机程序设计语言。 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的、大型项目的开发。 Python是一种解释型脚本语言,可以应用于以下领域:
- Web 和 Internet开发
- 科学计算和统计
- 人工智能
- 桌面界面开发
- 软件开发
- 后端开发
- 网络爬虫
<br>
下载Python
3.x版本的对一些函数做了限制,2.x支持,所以使用2.x,选了一个python自带pip的,版本为Python2.7.13。 官网下载地址:https://www.python.org/downloads/ 下载后,安装即可。
<br>
笔者补充
Python学习笔记后续会陆续发布,只讲实用不废话,最快速度上手Python。
<br>
Qt引入Python库
按照模块化,将python的libs和include目录拷贝到模块的路径下(参照“模块化”),模块pri文件如下: 
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
HEADERS += \
$$PWD/PythonManager.h
SOURCES += \
$$PWD/PythonManager.cpp
# python2.7.13
INCLUDEPATH += \
$$PWD/python2.7.13/include
LIBS += -L$$PWD/python2.7.13/libs
LIBS += -lpython27
<br>
模块化

<br>
测试运行
引入模块后的工程部署:
测试代码:
测试的python脚本和输出结果: 
<br>
工程模版v1.0.0

<br>
若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/109474663
版权声明
本文为[红模仿_红胖子]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4532295/blog/4707754
边栏推荐
猜你喜欢
![A compilation bug brought by vs2015 Update1 update [existing solutions]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
A compilation bug brought by vs2015 Update1 update [existing solutions]

【原创】ARM平台内存和cache对xenomai实时性的影响

爆一个VS2015 Update1更新带来的编译BUG【已有解决方案】

Judging whether paths intersect or not by leetcode

Git code submission operation, and git push prompt failed to push some refs'xxx '

C语言I博客作业03

计组-总线通信控制之异步串行通信的数据传输

工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?

洞察——风格注意力网络(SANet)在任意风格迁移中的应用

Got timeout reading communication packets解决方法
随机推荐
supervisor和Python多进程multiprocessing使用 子进程残留问题
ROS learning: remote start ROS node
Everything is 2020, LINQ query you are still using expression tree
数据库基本操作
Face recognition: attack types and anti spoofing techniques
Awk implements SQL like join operation
16.文件传输协议、vsftpd服务
面部识别:攻击类型和反欺骗技术
Adobe media encoder / me 2021 software installation package (with installation tutorial)
你可能不知道的Animation动画技巧与细节
Improvement of maintenance mode of laravel8 update
爆一个VS2015 Update1更新带来的编译BUG【已有解决方案】
Data transmission of asynchronous serial communication controlled by group bus communication
C / C + + Programming Notes: what are the advantages of C compared with other programming languages?
Judging whether paths intersect or not by leetcode
More than 50 object detection datasets from different industries
supervisor进程管理安装使用
微服务的出现和意义的探索
Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
C language I blog assignment 03