From 8de25859cb79a1cfcaa1472af5471db06677c3ee Mon Sep 17 00:00:00 2001 From: wxh0402 Date: Mon, 4 Jan 2021 18:17:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E4=BF=AE=E6=94=B9=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 21 +++++++++------------ requirements.txt | 6 +++--- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/main.py b/main.py index 590314b1..25ed14a1 100644 --- a/main.py +++ b/main.py @@ -403,19 +403,16 @@ def show_progress(self,file_name, total_size, now_size): import PyQt5.QtCore as qtc if __name__ == '__main__': 主进程PID = os.getpid() - # print(主进程PID) - # logger.info(sys.argv) - # 带参数传入打开程序 if len(sys.argv) > 1: - try: - #杀老进程 - os.system("taskkill /pid {} -f".format(sys.argv[1])) - time.sleep(5) - if "main.py" not in sys.argv[2]: - # 删除老版本 - os.remove(sys.argv[2]) - except Exception as error: - logger.error("error={} \n detail {}".format(error,traceback.print_exc())) + try: + #杀老进程 + os.system("taskkill /pid {} -f".format(sys.argv[1])) + time.sleep(5) + if "main.py" not in sys.argv[2]: + # 删除老版本 + os.remove(sys.argv[2]) + except Exception as error: + logger.error("error={} \n detail {}".format(error,traceback.print_exc())) if 窗口显示模式 == 1: if hasattr(qtc.Qt, 'AA_EnableHighDpiScaling'): QtWidgets.QApplication.setAttribute(qtc.Qt.AA_EnableHighDpiScaling, True) diff --git a/requirements.txt b/requirements.txt index 9fdfd9aa..290f7328 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -# pip install --user -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt +# pip install wheel==0.35.1 +# pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt lanzou-api==2.5.8.2 -wheel==0.35.1 pyinstaller==4.0 pypiwin32==223 -PyQt5==5.15.1 \ No newline at end of file +PyQt5==5.15.2 \ No newline at end of file