当前位置:网站首页>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年的程序员,应该具备怎么样的技术能力?该如何提升?
- C++基础知识篇:C++ 基本语法
- 14000 word distributed transaction principle analysis, master all of them, are you afraid of being asked in the interview?
- use Xunit.DependencyInjection Transformation test project
- The road of cloud computing: a free AWS cloud server
- See once to understand, graphic single chain table inversion
- 团灭 LeetCode 股票买卖问题
- 你可能不知道的Animation动画技巧与细节
- 学习Scala IF…ELSE 语句
- Static + code block + polymorphism + exception
猜你喜欢
【原创】ARM平台内存和cache对xenomai实时性的影响
C++基础知识篇:C++ 基本语法
使用 Xunit.DependencyInjection 改造测试项目
More than 50 object detection datasets from different industries
Go sending pin and email
Animation techniques and details you may not know
C语言I博客作业03
Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
Idea - the. IML file was not automatically generated by the project
What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
随机推荐
汇编函数mcall systemstack asmcgocall syscall
IDEA-项目未自动生成 .iml 文件
到底选openstack还是vmware?
C++基础知识篇:C++ 基本语法
Golang anonymous structure member, named structure member, inheritance, composition
Reflection on a case of bus card being stolen and swiped
VC6兼容性及打开文件崩溃问题解决
Learn Scala if Else statement
C语言I博客作业03
你的主机中的软件中止了一个已建立的连接。解决方法
洞察——风格注意力网络(SANet)在任意风格迁移中的应用
A compilation bug brought by vs2015 Update1 update [existing solutions]
WPF personal summary on drawing
使用jsDelivr加速你的网站
C language I blog assignment 03
Git code submission operation, and git push prompt failed to push some refs'xxx '
Web安全(一)---浏览器同源策略
Stack bracket matching
About the promotion of the whole stack of engineers, from the introduction to give up the secret arts, do not click in to have a look?
[solution] distributed timing task solution