chatWEB
This commit is contained in:
1
chat_command.py
Normal file
1
chat_command.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import openai
|
||||||
60
没有使用/wifi.py
60
没有使用/wifi.py
@@ -1,60 +0,0 @@
|
|||||||
import socket
|
|
||||||
from time import sleep
|
|
||||||
import os
|
|
||||||
import platform
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
ml = os.getcwd()
|
|
||||||
s = platform.system()
|
|
||||||
|
|
||||||
|
|
||||||
def is_connected():
|
|
||||||
try:
|
|
||||||
# 使用百度的IP地址进行连接测试
|
|
||||||
socket.create_connection(("www.baidu.com", 80))
|
|
||||||
return True
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
return False
|
|
||||||
def open_exe():
|
|
||||||
if os.path.exists(os.path.join(ml, f"client.exe")):
|
|
||||||
os.system(f"start client.exe")
|
|
||||||
else:
|
|
||||||
print('文件丢失,请重新安装')
|
|
||||||
sleep(1)
|
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# mainloop
|
|
||||||
print('正在启动检测程序...')
|
|
||||||
sleep(0.22222)
|
|
||||||
if s == "Windows":
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
print("无法启动,不是Windows系统!!")
|
|
||||||
sleep(1)
|
|
||||||
sys.exit()
|
|
||||||
if is_connected():
|
|
||||||
print("网络已连接,正在启动主程序!!")
|
|
||||||
sleep(0.33)
|
|
||||||
open_exe()
|
|
||||||
else:
|
|
||||||
print("网络未连接,是否继续使用?")
|
|
||||||
input_xz = str(input("选择:1.是 2.不是(必须选择数字)"))
|
|
||||||
if input_xz == None:
|
|
||||||
print("没有输入")
|
|
||||||
sleep(0.5)
|
|
||||||
print("默认退出")
|
|
||||||
sleep(0.6)
|
|
||||||
sys.exit()
|
|
||||||
pass
|
|
||||||
elif input_xz != '1' or '2':
|
|
||||||
print("请输入数字!!")
|
|
||||||
pass
|
|
||||||
elif input_xz == '1':
|
|
||||||
open_exe('client')
|
|
||||||
elif input_xz == '2':
|
|
||||||
sleep(0.4)
|
|
||||||
sys.exit()
|
|
||||||
Reference in New Issue
Block a user