当前位置:网站首页>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
边栏推荐
- QT hybrid Python development technology: Python introduction, hybrid process and demo
- Android Basics - RadioButton (radio button)
- Static + code block + polymorphism + exception
- The instanceof operator in ecmascript7 specification
- 来自不同行业领域的50多个对象检测数据集
- On the concurrency of update operation
- GoLand writes a program with template
- Adobe Lightroom / LR 2021 software installation package (with installation tutorial)
- 一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
- Adobe media encoder / me 2021 software installation package (with installation tutorial)
猜你喜欢
随机推荐
密码学-尚硅谷
Web Security (4) -- XSS attack
Stack bracket matching
The instanceof operator in ecmascript7 specification
2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
Cpp(一) 安装CMake
QT hybrid Python development technology: Python introduction, hybrid process and demo
Hand tearing algorithm - handwritten singleton mode
use Xunit.DependencyInjection Transformation test project
尾-递
Sentry installation
ubuntu实时显示cpu、内存占用率
面部识别:攻击类型和反欺骗技术
Basic knowledge of C + +
Android Basics - RadioButton (radio button)
Improvement of maintenance mode of laravel8 update
Get tree menu list
微信小程序request报400错误 @RequestBody接收不到
汇编函数mcall systemstack asmcgocall syscall
Cpp(四) Boost安装及基本使用 for Mac