From e2becf77773ad42275f26989fd434b0a80567b30 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Sat, 6 Apr 2024 16:50:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E7=88=B6=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E5=88=A4=E6=96=AD=20(#750)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/main.py b/main.py index d7637b1..0ad87bd 100644 --- a/main.py +++ b/main.py @@ -32,20 +32,6 @@ async def main_entry(): print("已自动安装缺失的依赖包,请重启程序。") sys.exit(0) - # 检查命令行 - import os - - if os.name == 'nt': - import psutil - allowed_parent_process = ['cmd.exe', 'powershell.exe', 'wsl.exe'] - - parent_process = psutil.Process(os.getppid()).name() - - if parent_process not in allowed_parent_process: - print("请在命令行中运行此程序。") - input("按任意键退出...") - exit(0) - # 检查配置文件 from pkg.core.bootutils import files @@ -77,7 +63,7 @@ if __name__ == '__main__': if "QChatGPT/main.py" not in content: invalid_pwd = True if invalid_pwd: - print("请在QChatGPT项目根目录下运行此程序。") + print("请在QChatGPT项目根目录下以命令形式运行此程序。") input("按任意键退出...") exit(0)