pip helper

This commit is contained in:
dengrb1
2023-05-12 19:30:07 +08:00
committed by GitHub
parent 45403f5d3d
commit 7c6873a729
2 changed files with 19 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
import sys
import os
from time import *
from time import sleep
import urllib.request
ml = os.getcwd()
@@ -15,11 +17,19 @@ def open_exe(exe_name):
print(file_error)
sleep(1)
pass
def check_internet(url='http://www.baidu.com/', timeout=5):
try:
urllib.request.urlopen(url, timeout=timeout)
return True
except Exception as e:
print('WIFI连接不正常请检测wifi连接后再试吧')
sleep(5)
return False
# try
try:
import pip
check_internet()
open_exe('client')
except ImportError:
print("请安装Pip或者python")