当前位置:网站首页>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
边栏推荐
- 工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
- 异常+abstract
- 2020天翼智能生态博览会中国电信宣布5G SA正式规模商用
- Privacy violation and null dereference of fortify vulnerability
- Goland 编写含有template的程序
- 构造请求日志分析系统
- What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
- Learn Scala if Else statement
- Everything is 2020, LINQ query you are still using expression tree
- Abnormal + Abstract
猜你喜欢

Judging whether paths intersect or not by leetcode

微服务的出现和意义的探索

Cryptography - Shangsi Valley

Animation techniques and details you may not know

面部识别:攻击类型和反欺骗技术

Hand tearing algorithm - handwritten singleton mode

Face recognition: attack types and anti spoofing techniques

密码学-尚硅谷

Ladongo open source full platform penetration scanner framework

Problems of Android 9.0/p WebView multi process usage
随机推荐
洞察——风格注意力网络(SANet)在任意风格迁移中的应用
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
What details does C + + improve on the basis of C
[original] the influence of arm platform memory and cache on the real-time performance of xenomai
Insight -- the application of sanet in arbitrary style transfer
static+代码块+多态+异常
Lay UI left tree Dtree right list table
Face recognition: attack types and anti spoofing techniques
What magic things can a line of Python code do?
C++基础知识篇:C++ 基本语法
Got timeout reading communication packets解决方法
一次公交卡被“盗刷”事件带来的思考
sed之查找替换
Improvement of maintenance mode of laravel8 update
密码学-尚硅谷
Hand tearing algorithm - handwritten singleton mode
Static + code block + polymorphism + exception
Improvement of maintenance mode of laravel8 update
A compilation bug brought by vs2015 Update1 update [existing solutions]