pip helper
This commit is contained in:
12
python_jc.py
12
python_jc.py
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user