展开全部
Python编程中e69da5e887aa62616964757a686964616f31333337396234,用Tkinter中的文本框获取系统当前的时间并且显示,代码如下:import sys
from tkinter import *
import time
def tick():
global time1
# 从运行程序的计算机上面获取当前的系统时间
time2 = time.strftime('%H:%M:%S')
# 如果时间发生变化,代码自动更新显示的系统时间
if time2 != time1:
time1 = time2
clock.config(text=time2)
# calls itself every 200 milliseconds
# to update the time display as needed
# could use >200 ms, but display gets jerky
clock.after(200, tick)
root = Tk()
time1 = ''
status = Label(root, text="v1.0", bd=1, relief=SUNKEN, anchor=W)
status.grid(row=0, column=0)
clock = Label(root, font=('times', 20, 'bold'), bg='green')
clock.grid(row=0, column=1)
tick()
root.mainloop()