以下代码紧接上一篇文章《python如何创建秒表(1)》
# If rest is pressed after pressing stop.
if
running==False:
reset['state']='disabled'
label['text']='Welcome!'
# If reset is pressed while the stopwatch is running.
else:
label['text']='Starting...'
root =
Tkinter.Tk()
root.title("Stopwatch")
# Fixing the window size.
root.minsize(width=250, height=70)
label =
Tkinter.Label(root, text="Welcome!", fg="black", font="Verdana 30 bold")
label.pack()
start =
Tkinter.Button(root, text='Start',
width=15, command=lambda:Start(label))
stop =
Tkinter.Button(root, text='Stop',
width=15, state='disabled', command=Stop)
reset =
Tkinter.Button(root, text='Reset',
width=15, state='disabled', command=lambda:Reset(label))
start.pack()
stop.pack()
reset.pack()
root.mainloop()









暂无数据