01 2020 档案

摘要:使用Pyqt编程过程中,经常会遇到给槽函数传递额外参数的情况。但是信号-槽机制只是指定信号如何连接到槽,信号定义的参数被传递给槽,而额外的参数(用户定义)不能直接传递。 而传递额外参数又是很有用处。你可能使用一个槽处理多个组件的信号,有时要传递额外的信息。 一种方法是使用lambda表达式。 fro 阅读全文
posted @ 2020-01-19 11:13 Ubuntu1804 阅读(545) 评论(0) 推荐(0)
摘要:逻辑文件 import sys import serial import serial.tools.list_ports from Ui_day13_test01 import Ui_mainWindow from PyQt5.QtWidgets import QMainWindow,QApplic 阅读全文
posted @ 2020-01-14 13:51 Ubuntu1804 阅读(2503) 评论(0) 推荐(1)
摘要:程序代码如下: import serial,threading,time class SerThread(): def __init__(self,portx): # 初始化串口 self.my_serial=serial.Serial() self.my_serial.port=portx sel 阅读全文
posted @ 2020-01-10 10:44 Ubuntu1804 阅读(2521) 评论(0) 推荐(0)
摘要:代码功能说明:1.向串口助手发送十六进制数据:0X01,0X03,0X00,0X00,0X00,0X01,0X84,0X0A; 2.用串口助手向代码发送数据,并将发送过来的数据保存在数据库中,按数据和保存数据形式保存到数据库中。 代码如下: import serial,pymysql,threadi 阅读全文
posted @ 2020-01-09 13:21 Ubuntu1804 阅读(23607) 评论(3) 推荐(3)
摘要:附:strftime参数 strftime(format[, tuple]) -> string 将指定的struct_time(默认为当前时间),根据指定的格式化字符串输出 python中时间日期格式化符号: %y 两位数的年份表示(00-99) %Y 四位数的年份表示(000-9999) %m 阅读全文
posted @ 2020-01-08 14:27 Ubuntu1804 阅读(276) 评论(0) 推荐(0)