try: for line in open("./log.txt", "r"): # 设置文件对象并读取每一行文件 # data.append(line) # 将每一行文件加入到list中 self.teLog.append(line) except Exception as e: print(e) QMessageBox.warning(self, "消息框标题", "未找到日志信息", QMessageBox.Yes)
python 3 try except (try catch)
最新推荐文章于 2022-08-24 11:21:44 发布