python 3 try except (try catch)
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)
浙公网安备 33010602011771号