当前位置:网站首页>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
边栏推荐
- Awk implements SQL like join operation
- 云计算之路-出海记:整一台 aws 免费云服务器
- 看一遍就理解,图解单链表反转
- Android 9.0/P WebView 多进程使用的问题
- These core technology of object-oriented, after you master it, you can have a good interview
- QT hybrid Python development technology: Python introduction, hybrid process and demo
- Static + code block + polymorphism + exception
- The road of cloud computing: a free AWS cloud server
- 【解决方案】分布式定时任务解决方案
- On the concurrency of update operation
猜你喜欢
2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
【原创】ARM平台内存和cache对xenomai实时性的影响
Delphi10's rest.json And system.json Step on the pit
Judging whether paths intersect or not by leetcode
Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
云计算之路-出海记:整一台 aws 免费云服务器
Data structure and sorting algorithm
Design pattern of facade and mediator
获取树形菜单列表
你可能不知道的Animation动画技巧与细节
随机推荐
Getting started with go wire dependency injection
What magic things can a line of Python code do?
Data transmission of asynchronous serial communication controlled by group bus communication
学习Scala IF…ELSE 语句
Python image recognition OCR
16. File transfer protocol, vsftpd service
Speed up your website with jsdelivr
Download, installation and configuration of Sogou input method in Ubuntu
构造请求日志分析系统
GET,POST,PUT,DELETE,OPTIONS用法与说明
C / C + + Programming Notes: what are the advantages of C compared with other programming languages?
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
Python 图片识别 OCR
Sentry installation
What details does C + + improve on the basis of C
Android 9.0/P WebView 多进程使用的问题
VC6兼容性及打开文件崩溃问题解决
Judging whether paths intersect or not by leetcode
C++基础知识篇:C++ 基本语法
看一遍就理解,图解单链表反转