-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome.py
executable file
·55 lines (39 loc) · 1.33 KB
/
welcome.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from login import *
#账号
def r1(root):
global choice
choice = 1
root.destroy()
# 游客
def r0(root):
global choice
choice = -1
root.destroy()
choice = 0
def DengLu():
root = tk.Tk()
root.title('欢迎使用12306查询购票系统3.0')
img_open = Image.open('./Images/12306.png')
img_png = ImageTk.PhotoImage(img_open)
label_img = tk.Label(root, image = img_png)
label_img.pack(side=tk.TOP)
yonghu=tk.Button(root,text="登 录",font=5,bg='CornflowerBlue',fg='White',command=lambda :r1(root))
yonghu.pack(padx=85, side=tk.LEFT)
huanyin=tk.Label
youke=tk.Button(root,text="游客登录",font=5,bg='DimGray',fg='White',command=lambda :r0(root))
youke.pack(padx=85, side=tk.RIGHT)
# center_window(root, 300, 80)
root.geometry('469x223+700+450')
root.maxsize(469, 223)
root.minsize(469, 223)
root.mainloop()
return choice
# 居中函数
# def get_screen_size(window):
# return window.winfo_screenwidth(), window.winfo_screenheight()
#
# def center_window(root, ckwidth, ckheight):
# pmwidth = root.winfo_screenwidth()
# pmheight = root.winfo_screenheight()
# size = '%dx%d+%d+%d' % (ckwidth, ckheight, (pmwidth - ckwidth) / 2, (pmheight - ckheight) / 2)
# root.geometry(size)