From b43a15ad1c4879fc8f1f3bd5f0e9f3f4d04e9e03 Mon Sep 17 00:00:00 2001 From: Qiao <572381217@qq.com> Date: Sun, 29 Sep 2024 20:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(ALL):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=8D=95=E5=AE=9E=E4=BE=8B=E6=A3=80=E6=B5=8B=20=20-=20?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=90=AF=E5=8A=A8=E5=A4=9A=E4=B8=AANCD,?= =?UTF-8?q?=E8=BF=99=E6=A0=B7=E4=BC=9A=E5=AF=BC=E8=87=B4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=A5=87=E6=80=AA=E7=9A=84=E9=97=AE=E9=A2=98=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index e87d706..1c0b910 100644 --- a/main.py +++ b/main.py @@ -21,10 +21,10 @@ if __name__ == "__main__": # 检查是否已经有 NCD 在运行了, 如果有则取消运行 - for proc in psutil.process_iter(): - if proc.name() == "NapCat-Desktop.exe": + for proc in psutil.process_iter(['name']): + if proc.info['name'] == "NapCat-Desktop.exe": sys.exit() - + # 调整程序 log 输出 Logger() # 检查是否以管理员模式启动, 非管理员模式尝试获取管理员权限