From e2fc8dc03ecf390fd4c150b2fb348e7a874eda36 Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:00:08 +0800 Subject: [PATCH] 2023/8/30 update --- python_jc.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/python_jc.py b/python_jc.py index 3325fe1..5a50c5d 100644 --- a/python_jc.py +++ b/python_jc.py @@ -23,6 +23,7 @@ def check_internet(url='http://www.baidu.com/', timeout=5): try: urllib.request.urlopen(url, timeout=timeout) open_exe('client') + os.system("taskill -f -t -im python_jc.exe") return True except Exception as e: print(f'{ERROR_MSG}{strftime("%Y-%m-%d %H:%M:%S")}: WIFI连接不正常,请检测wifi连接后再试吧') @@ -41,9 +42,12 @@ def check_internet(url='http://www.baidu.com/', timeout=5): print('错误:没有输入文字') sleep(1.5) return False - sleep(1.8) - sys.exit() - pass + + +check_internet() + +sleep(0.4) +sys.exit() '''def check_python_installation(): @@ -105,10 +109,4 @@ def check_internet(url='http://www.baidu.com/', timeout=5): else: print('错误:没有输入文字,默认退出!') sleep(1.5) - sys.exit()''' - - -if __name__ == '__main__': - check_internet() - sleep(1) - os.system("taskill -f -t -im python_jc.exe") \ No newline at end of file + sys.exit()''' \ No newline at end of file