Python
Python相关
mtjmtj7啊
这个作者很懒,什么都没留下…
展开
-
subprocess
subprocess原创 2022-12-20 18:37:22 · 98 阅读 · 0 评论 -
QTDesiger生成后文件模版
QTDesiger生成后文件模版原创 2022-06-04 23:17:52 · 254 阅读 · 0 评论 -
python Logbook
python loggbook原创 2022-03-27 20:14:24 · 1035 阅读 · 0 评论 -
tensor保存图像
def denorm(x): """Convert the range from [-1, 1] to [0, 1].""" out = (x + 1) / 2 return out.clamp_(0, 1) def tensor2img(x_data, fname, nrow, paddoing=0): save_image(denorm(x_data.cpu()), fname, nrow=nrow, padding=0)原创 2022-03-18 21:30:21 · 1391 阅读 · 0 评论 -
pyqt5 QTimer使用
创建 self.timer = QTimer() self.timer.timeout.connect(self.showTime) self.start_btn.clicked.connect(self.startTimer) self.stop_btn.clicked.connect(self.endTimer) self.count = 0 开始 \ 停止 def showTime(self): if self.count != 100: se.原创 2021-04-20 23:10:57 · 246 阅读 · 1 评论 -
python ini工具类
from configparser import ConfigParser import os class ReadWriteConfFile(object): path = 'config.ini' # 可根据需要替换成自己的路径 @staticmethod def get_parser(): cf = ConfigParser() cf.read(ReadWriteConfFile.path, encoding='utf-8')转载 2021-04-19 18:19:07 · 170 阅读 · 0 评论 -
PyQt5 QThread倒计时
创建多线程类 全局变量 sec class work_thread(QThread): timer = pyqtSignal() # 每隔一秒发送信号 end = pyqtSignal() # 计数完成发送信号 def run(self) -> None: while True: self.sleep(1) if sec == 0: self.end.emit() # 发.原创 2021-03-31 10:41:02 · 399 阅读 · 4 评论 -
PyQt5 QTimer使用
创建timer,绑定事件 self.timer = QTimer() self.timer.timeout.connect(self.showTime) self.pushButton.clicked.connect(self.startTime) self.pushButton_2.clicked.connect(self.endTime) def showTime(self): time = QDateTime.currentDateTime() time_display = t..原创 2021-03-31 10:09:33 · 312 阅读 · 0 评论 -
Pycharm 配置 PyQt5 快捷工具
Pycharm 配置 PyQt5 快捷工具 1. 打开pycharm设置 2. 添加QTDesigner name : 随意(QTDesigner description: 随意 program:选择designer.exe路径。 arguments: $FileDir$\$FileName$ working dictionary:$FileDir$ 3. 添加PyUIC name :随意 description:随意 program:python.exe arguements:原创 2021-03-30 15:43:29 · 173 阅读 · 0 评论