chatGPT
This commit is contained in:
79
client.pyw
79
client.pyw
@@ -1,81 +1,56 @@
|
|||||||
import os
|
import os
|
||||||
from tkinter import *
|
|
||||||
from tkinter import ttk, messagebox
|
|
||||||
import platform
|
import platform
|
||||||
|
import tkinter as tk
|
||||||
|
from tkinter import ttk, messagebox
|
||||||
|
|
||||||
|
# Define constants
|
||||||
|
CURRENT_DIR = os.getcwd()
|
||||||
|
FILE_ERROR = '文件丢失,请检查文件内容并重新安装'
|
||||||
|
|
||||||
root = Tk()
|
# Define functions
|
||||||
ml = os.getcwd()
|
def open_exe(exe_name):
|
||||||
system = platform.system()
|
if os.path.exists(os.path.join(CURRENT_DIR, f"{exe_name}.exe")):
|
||||||
flie_error = '文件丢失,请检查文件内容并重新安装'
|
os.system(f"start {exe_name}.exe")
|
||||||
|
else:
|
||||||
|
messagebox.showerror('system', FILE_ERROR)
|
||||||
|
|
||||||
def extkj():
|
def extkj():
|
||||||
if os.path.exists("{ml}\extkj.exe"):
|
open_exe("extkj")
|
||||||
os.system('start {ml}\extkj.exe')
|
|
||||||
else:
|
|
||||||
messagebox.showerror('system', flie_error)
|
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
def wuguokai():
|
def wuguokai():
|
||||||
if os.path.exists("{ml}\wuguokai.exe"):
|
open_exe("wuguokai")
|
||||||
os.system("start {ml}\wuguokai.exe")
|
|
||||||
else:
|
|
||||||
messagebox.showerror('system', flie_error)
|
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
def f1():
|
def f1():
|
||||||
if os.path.exists("{ml}\\f1.exe"):
|
open_exe("f1")
|
||||||
os.system("start {ml}\\f1.exe")
|
|
||||||
else:
|
|
||||||
messagebox.showerror('system', flie_error)
|
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
def lbb():
|
def lbb():
|
||||||
if os.path.exists("{ml}\lbb.exe"):
|
open_exe("lbb")
|
||||||
os.system("start {ml}\lbb.exe")
|
|
||||||
else:
|
|
||||||
messagebox.showerror('system', flie_error)
|
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
def update():
|
def update():
|
||||||
if os.path.exists("{ml}\\update.exe"):
|
if os.path.exists(os.path.join(CURRENT_DIR, "update.exe")):
|
||||||
os.system("start {ml}\\update.exe")
|
os.system("start update.exe")
|
||||||
else:
|
else:
|
||||||
messagebox.showerror('update', '更新日志文件丢失,请检查文件并重新安装')
|
messagebox.showerror('update', '更新日志文件丢失,请检查文件并重新安装')
|
||||||
pass
|
|
||||||
pass
|
|
||||||
|
|
||||||
def quit_exe():
|
def quit_exe():
|
||||||
root.destroy()
|
root.destroy()
|
||||||
pass
|
|
||||||
|
|
||||||
|
# Create GUI
|
||||||
|
root = tk.Tk()
|
||||||
|
root.title('chatGPT')
|
||||||
|
root.geometry('200x200+400+400')
|
||||||
|
tk.Label(root, text='chatGPT').pack()
|
||||||
|
|
||||||
# button
|
bt_w = tk.Button(root, text='wuguokai网站', command=wuguokai)
|
||||||
bt_e = Button(root ,text='extkj网站', command=extkj)
|
bt_e = tk.Button(root, text='extkj网站', command=extkj)
|
||||||
bt_w = Button(root ,text='wuguokai网站', command=wuguokai)
|
bt_f1 = tk.Button(root, text='f1网站', command=f1)
|
||||||
bt_f1 = Button(root, text='f1网站', command=f1)
|
bt_update = tk.Button(root, text='更新日志', command=update)
|
||||||
bt_update = Button(root, text='更新日志', command=update)
|
quit_bt = tk.Button(root, text='退出', command=quit_exe)
|
||||||
quit_bt = Button(root, text='退出', command=quit_exe)
|
|
||||||
|
|
||||||
|
|
||||||
# Label
|
|
||||||
Label(root, text='chatGPT').pack()
|
|
||||||
|
|
||||||
|
|
||||||
# pack_2
|
|
||||||
bt_w.pack()
|
bt_w.pack()
|
||||||
bt_e.pack()
|
bt_e.pack()
|
||||||
bt_f1.pack()
|
bt_f1.pack()
|
||||||
bt_update.pack()
|
bt_update.pack()
|
||||||
quit_bt.pack()
|
quit_bt.pack()
|
||||||
|
|
||||||
|
|
||||||
# mainloop
|
|
||||||
root.title('chatGPT')
|
|
||||||
root.geometry('200x200+400+400')
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
Reference in New Issue
Block a user