From f750ab98403458bd6add5b8387db1973dab9b17c Mon Sep 17 00:00:00 2001 From: dengrb1 <125752069+dengrb1@users.noreply.github.com> Date: Wed, 24 May 2023 17:14:09 +0800 Subject: [PATCH] chatWEB --- update.pyw | 4 +++- wifi_jc.py | 46 +++++++++++++++++++++++++++++++++++++++++++ lbbai.pyw => xjai.pyw | 2 +- xz_chat.pyw | 8 ++++---- 4 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 wifi_jc.py rename lbbai.pyw => xjai.pyw (89%) diff --git a/update.pyw b/update.pyw index 1c68a38..4aa1645 100644 --- a/update.pyw +++ b/update.pyw @@ -30,8 +30,10 @@ text = '''0.1.0 DEMO制作完成 1.1.1 更新chatGPT网站;修改update文本显示设置。新增bnu120聊天网站 移除lbbai网站入口 1.2 增加lbbai网站;修复BUG;完全移除“关于”模块...... +1.3 删除lbbai网站;增加xjai网站,里面内涵AI画图功能!;加入WiFi功能 +检测 -当前版本:1.2 (Not beta or demo)''' +当前版本:1.3 (Not beta or demo)''' text_box = ScrolledText(root) text_box.pack(fill=BOTH, expand=1) diff --git a/wifi_jc.py b/wifi_jc.py new file mode 100644 index 0000000..0c2c0b8 --- /dev/null +++ b/wifi_jc.py @@ -0,0 +1,46 @@ +import sys +import os +import urllib.request +import webbrowser +from time import sleep, strftime + + +ml = os.getcwd() +file_error = '文件丢失,请重新安装!!' +ERROR_MSG = '错误:' + + +def open_exe(exe_name): + if os.path.exists(os.path.join(ml, f"{exe_name}.exe")): + os.system(f"start {exe_name}.exe") + else: + print(file_error) + sleep(1) + + +def check_internet(url='http://www.baidu.com/', timeout=5): + try: + urllib.request.urlopen(url, timeout=timeout) + open_exe('client') + return True + except Exception as e: + print(f'{ERROR_MSG}{strftime("%Y-%m-%d %H:%M:%S")}: WIFI连接不正常,请检测wifi连接后再试吧') + sleep(5) + print('是否继续启动程序(Y.是,N.不是)?') + input_xz = str(input('>>>')) + if input_xz != None: + if input_xz.lower() == 'y': + open_exe('client') + elif input_xz.lower() == 'n': + sys.exit() + else: + print('请输入英文字母!!') + sleep(1.5) + else: + print('错误:没有输入文字') + sleep(1.5) + return False + + +if __name__ == '__main__': + check_internet() \ No newline at end of file diff --git a/lbbai.pyw b/xjai.pyw similarity index 89% rename from lbbai.pyw rename to xjai.pyw index a30b41f..ba97acf 100644 --- a/lbbai.pyw +++ b/xjai.pyw @@ -9,7 +9,7 @@ class Browser(QMainWindow): self.setWindowTitle('浏览器') self.browser = QWebEngineView() - self.browser.setUrl(QUrl('https://link.lbbai.com')) + self.browser.setUrl(QUrl('https://home.xjai.cc')) self.setCentralWidget(self.browser) refresh_button = QAction('刷新', self) diff --git a/xz_chat.pyw b/xz_chat.pyw index b84d65b..47b19e7 100644 --- a/xz_chat.pyw +++ b/xz_chat.pyw @@ -43,8 +43,8 @@ def qdymys(): open_exe("qdymys") def bnu120(): open_exe('bnu120') -def lbbai(): - open_exe('lbbai') +def xjai(): + open_exe('xjai') def fh(): root.destroy() @@ -53,7 +53,7 @@ def fh(): bt_wuguokai = Button(frame, text='wuguokai网站', command=wuguokai) bt_extkj = Button(frame, text='extkj网站', command=extkj) bt_qdymys = Button(frame, text='qdymys网站', command=qdymys) -bt_lbbai = Button(frame, text='lbbai网站', command=lbbai) +bt_xjai = Button(frame, text='xjai网站', command=xjai) bt_bnu120 = Button(frame, text='bnu120网站', command=bnu120) bt_fh = Button(frame, text='返回', command=fh) @@ -61,7 +61,7 @@ bt_fh = Button(frame, text='返回', command=fh) Label(root, text='选择界面').pack() bt_wuguokai.pack() bt_extkj.pack() -bt_lbbai.pack() +bt_xjai.pack() bt_qdymys.pack() bt_bnu120.pack() bt_fh.pack()