From 9f0a37324c5d4668f2103523ee053e05668b4791 Mon Sep 17 00:00:00 2001 From: chase Date: Sat, 5 Aug 2023 21:28:09 +0800 Subject: [PATCH] fixed the exit() bug --- save2excel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/save2excel.py b/save2excel.py index 97c4123..8d14826 100644 --- a/save2excel.py +++ b/save2excel.py @@ -4,6 +4,7 @@ import os import xlwt +import sys def save2excel(dbpath): @@ -82,14 +83,14 @@ def gettable(dbpath): if tablelist == None: print("目标数据库不存在或者内容为空,请检查数据库,即将退出") sleep(1) - exit() + sys.exit(-1) print("\n") x = 99 while x != 0: sleep(0.5) print("当前目录数据库中含有以下table(数据表格)pubmed后面的数字为生成时精确到秒的时间\n", '----' * 20, '\n') for i in range(len(tablelist)): - print("[%d]%s " % (i + 1, tablelist[i]), end='') + print("[%d]%s " % (i + 1, tablelist[i])) print("\n") print('----' * 20) try: