pyqt

python3 +qt5,用pyqt5写一个crc校验工具,crc8 crc16 crc32 crc32

好久不见. 提交于 2020-08-14 04:46:40
python3 +qt5,用pyqt5写一个crc校验工具,crc8 crc16 crc32 crc32 1. 概述 2. 实现 1. 概述 在上一篇博客中分析了crc的原理链接: 图解crc校验,crc8, crc16, crc32, crc24 用 c语言和python实现 . 在最后实现部分,只是简单的讲CRC24的源码放在了后面,距离我们做一个工具的目标还有距离,这篇文章就是将我们想法实现了,做一个工具,随时都可以用的。 闲话不多说,先上一张效果图(PS:这只是第一版,只有基础的计算,还有很多功能在完善中): 这里的测试数据是: 00 00 00 00 02 00 44 00 02 10 00 25 00 28 0c 00 10 00 02 49 74 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 02 49 74 36 48 55 5c 07 7c ef 00 81 00 00 e1 88 01 31 00 00 00 00 10 00 03 96 64 34 00 02 03 00 02 00 01 01 01 00 21 c0 80 73 10 27 00 00 b6 b5 f7 4f b7 65 9a f8 5b 01 ef be 00 00 00 00 00 00 00 00 00 c8 f5 f0 00

PyQt5之QMessageBox的用法用例

◇◆丶佛笑我妖孽 提交于 2020-08-13 09:08:19
PyQt5之QMessageBox的用法用例 PyQt5之QMessageBox的用法用例,对应C++也是一样的使用方式,API未变。 QMessageBox自定义了几个常用的消息框,常用的如下两个: 1、警告消息窗 python: QMessageBox . warning ( self . __MainWindow , '标题' , '我是文本' , QMessageBox . Close ) C++: QMessageBox::warning(this, '标题', '我是文本', QMessageBox.Close) 2、信息提示消息窗 python: QMessageBox . information ( self . __MainWindow , '标题' , '我是文本' , QMessageBox . Close ) C++: QMessageBox::information(this, '标题', '我是文本', QMessageBox.Close) 3、自定义一个消息窗 python: # 创建一个消息窗 mb = QMessageBox ( self . __MainWindow ) # 设置标题 mb . setWindowTitle ( '标题' ) # 设置显示内容 mb . setText ( '测试QMessageBox' ) # 添加关闭按钮 mb

9个动图带你进入PyQtGraph的强大可视化世界

自作多情 提交于 2020-08-13 07:24:36
PyQtGraph是一个建立在PyQt/PySide之上的Python数据可视化图形界面库,其性能强、速度快,能够胜任大部分交互式的2D、3D图形绘制,可以搞定数据科学领域大量的数据可视化工作。 州的先生之前绘制的A股股票动态K线图,就是使用PyQtGraph绘制的。 A股复苏,入场还是解套?Python秒绘交互式股票K线图 PyQtGraph官方提供了很好的示例来供学习者了解PyQtGraph的功能,下面我们通过9个图形,来一窥PyQtGraph的可视化世界。 基础的数组绘制折线图 # coding:utf-8 # 作者:州的先生 # 博客:https://zmister.com from pyqtgraph . Qt import QtGui , QtCore import numpy as np import pyqtgraph as pg # 实例化一个绘图窗口 win = pg . GraphicsWindow () win . resize ( 1000 , 600 ) win . setWindowTitle ( 'PyQtGraph基础绘图示例 - zmister.com' ) # 启用抗锯齿选项 pg . setConfigOptions ( antialias = True ) # 使用addPlot()方法直接添加一个数组以绘制图形 p1 = win .

Python全栈学习笔记

落爺英雄遲暮 提交于 2020-08-12 20:40:24
pystudy Hi, Guys, Welcome to pystudy! You will Learn the python3 language here, from entry to abandonment! I will keep updating study notes here, commit codes and add comment ! Python环境搭建 Linux系统UOS SP1上搭建Python开发环境.(IDE:PyCharm和VsCode) Python基础入门 1.语法格式 2.变量定义类型和使用 3.条件循环语句if-else_while_for 4.字符串、列表、元组、字典、集合 Python进阶 1.函数 2.数据结构公共方法 3.面向对象基础及封装 4.类的继承(派生)、方法重写、类的私有属性和方法、多继承 5.多态 6.类属性、类方法、静态方法 7.异常 8.模块和包 9.文件操作和编码 Python高级 网络编程: UDP/TCP/HTTP 网络编程: POP3/SMTP收发邮件 线程/进程/协程,并发 高级语法 正则表达式 CGI编程 Python爬虫及数据分析 python爬虫基础 python多线程爬虫 python分布式爬虫(爬虫框架) python反爬机制 项目案例: 爬取南京房价并可视化展示 爬取知乎或微博或技术博客等优秀文章

兼容 PyQt5 与 PySide2 代码构建 Qt 平台

别说谁变了你拦得住时间么 提交于 2020-08-12 20:23:03
在 xinetzone / xinet 放置 qt5.py 用于兼容 PyQt5 与 PySide2 代码: try : # PySide2 from PySide2 import QtGui , QtWidgets , QtCore , QtPrintSupport from PySide2 . QtCore import Signal , Slot except ImportError : # PyQt5 from PyQt5 import QtGui , QtWidgets , QtCore , QtPrintSupport from PyQt5 . QtCore import pyqtSignal as Signal , pyqtSlot as Slot 该库提供 pip 支持: pip install xinet Qt5 内容将以此模块进行开发。为了方便调用窗口,封装一个启动界面的 API: # xinet/run_qt.py from . Qt . qt5 import QtWidgets def run ( window_type , * args , ** kwargs ) : import sys app = QtWidgets . QApplication ( sys . argv ) window = window_type ( * args , **

PyQt:使用QtDesigner设计界面

六眼飞鱼酱① 提交于 2020-08-11 07:31:07
目录 1、安装pyqt5designer、pyqt5 2、pycharm中添加外部工具 3、使用QtDesigner设计页面 1、安装相关库   pip install pyqt5designer   pip install pyqt5 2、pycharm添加外部工具   在setting中添加两个工具      QtDesigner中按照如图填写:   Programe:选择designer的安装目录,当pip install pyqt5designer安装完成后就会出现,也可以双击直接打开QtDesigner   Working directory: $ProjectFileDir$         PyUIC:这个工具可以将QtDesigner拖拽设计的页面转化为py文件   参数填写说明:   Programe:如图,其他版本(除了PyQt5)可能不在此路径   Arguments: -o $FileNameWithoutExtension$.py $FileName$   Working directory: $FileDir$      打开QtDesigner工具设计页面    3、简单设计一个login页面     1、创建界面,选择Wdiget     2、分别在窗口添加如下控件,Lable、pushButton、checkBox、lineEdit如图所示:   

PyQt5: Create transparent window with opaque widgets

孤人 提交于 2020-08-09 09:44:28
问题 Is it possible to make mainWindow completely transparent while other widgets remains visible? For example: I want to make app transparent and make everything else visible (like, mainFrame, close button, minimize button) 回答1: As @Felipe mentioned you can use window.setAttribute(QtCore.Qt.WA_TranslucentBackground) here is a little example: import sys from PyQt5 import QtWidgets, QtCore app = QtWidgets.QApplication(sys.argv) # create invisble widget window = QtWidgets.QWidget() window

PyQt的使用

末鹿安然 提交于 2020-08-07 21:37:41
一直以来做界面都是用VS,或者一些专用的工具。最近要做一个小工具,朋友建议用PyQt,于是学习了一下,做此记录。 本质上,PyQt就是Qt,只不过用Qt Designer创建界面之后,再把生成的xml文件A用pyuic转成py文件B,然后再在py文件C中导入B,即可进行调用。其中A类似于WPF中的xaml,B类似于VS从xaml生成的g.cs和g.i.cs,而C类似于xaml.cs文件。 因为装了Anaconda,好像自带了PyQt需要的工具包,因此就不折腾了,直接打开Anaconda Prompt,运行designer.exe。整个界面和VS很像,从左边拖一些控件到中间的窗口上即可。 设计完成后保存,默认保存为ui文件。 保存之后,在Anaconda Prompt中运行pyuic5指令,将test.ui转换为test.py pyuic5.bat -o test.py test.ui 此时在相应的目录下生成test.py。 查看test.py的内容如下,可见其内容为控件布局,命名等。 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file '.\test.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All

pycharm报错:Process finished with exit code -1073741819 (0xC0000005)解决办法

廉价感情. 提交于 2020-08-07 08:12:50
这个是几个月前的问题了,有小伙伴在CSDN问我咋解决的,那我今天在这边把这个问题解决办法分享下吧,免得大家把很多时间都浪费在安装排坑上面,有些坑虽然解决了还真不知道啥原因。 我的pycharm一直用的好好的,然后装了个labelme(labelme里面需要安装PyQt)之后运行程序开始报错 pycharm报错:Process finished with exit code -1073741819 (0xC0000005) 网上找了很多网友分享的解决办法最终把问题解决了, 就是把h5py升级到2.9.0就不在报错了,啥原因我也不知道!!! 下面贴上其他解决办法,大家遇到这个错误,一个个都尝试下,就能解决了。 附上博客链接: https://blog.csdn.net/wangguan9527/article/details/82845409#commentsedit 来源: oschina 链接: https://my.oschina.net/u/4321917/blog/4476681

Add border under column headers in QTableWidget

懵懂的女人 提交于 2020-08-07 06:27:04
问题 I have a table widget with two column header in a dialog that looks like this: There is a separation between the column headers named "Index" and "Label", but there is no separating border between these header and the row below them. How can this be added? Say the table is instantiated as: table = QTableWidget(6, 2, self) I know that I can get the first horizontal header as a QTableWidgetItem by doing headerItem = table.horizontalHeaderItem(0) modify some properties and set it back, but I'm