|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- from tkinter import *
- import time
- root=Tk()
- e=Canvas(root,
- width=436,
- height=591,
- background="khaki")
- e.pack()
- e.create_line(0,286,436,286,
- fill="royalblue",
- width=24,
- arrow="both",
- arrowshape=(244,344,244))
- def gyl():
- d=time.strftime("%T")
- root.after(1000,gyl)
- e.create_text(200,275,
- text=d,
- font="方正流行体简体 44 bold",
- fill="fuchsia")
- gyl()
- mainloop()
复制代码
from tkinter import *
import time
root=Tk()
e=Canvas(root,
width=436,
height=591,
background="khaki")
e.pack()
e.create_line(0,286,436,286,
fill="royalblue",
width=24,
arrow="both",
arrowshape=(244,344,244))
d = time.strftime("%T")
text_id = e.create_text(200,275,
text=d,
font="方正流行体简体 44 bold",
fill="fuchsia")
def gyl():
d = time.strftime("%T")
e.itemconfig(text_id, text=d)
root.after(1000, gyl)
gyl()
mainloop()
|
|