1
저는 파이썬을 통해 응용 프로그램을 만들고 있습니다. 만들고있는 탭 중 하나는 현재 시간을 표시하는 것입니다 : 로컬 및 GMT. 프로그램을 시작하면 프로그램 시작 시간을 알 수 있습니다. 시간을 업데이트하여 응용 프로그램에서 실제 시간을 가질 수있는 방법이 있는지 궁금합니다.메모장 탭에서 시계 업데이트하기
from Tkinter import *
from ttk import *
import time
root = Tk()
root.geometry('1000x900')
root.title("Astronomical Observing Recording Program")
frame1 = Frame(root, name='frame1')
frame1.pack(fill=BOTH)
localtime = time.asctime(time.localtime(time.time()))
gmttime = time.asctime(time.gmtime(time.time()))
welcome_message = "Hi" #shortened
current_time = "The current time is: " + str(localtime)
gmt_time = "The current GMT time is: " + str(gmttime)
root.protocol("WM_DELETE_WINDOW", frame1.quit)
nb = Notebook(frame1, name='nb')
nb.pack(fill=BOTH, padx=2, pady=3)
welcome_screen = Frame(nb, name='welcome_screen')
Label(welcome_screen, text=welcome_message).pack(side=LEFT)
nb.add(welcome_screen, text='Welcome')
time_screen = Frame(frame1, name='time_screen')
Label(time_screen, text=current_time).pack(side=TOP)
Label(time_screen, text=gmt_time).pack(side=TOP)
nb.add(time_screen, text='Time Bar')
frame1.mainloop()
누군가가 나를 도와, 또는 오른쪽에 저를 설정할 수 있다면 감사하겠습니다 : 이것은 내가 지금까지 내 응용 프로그램이 무엇 http://ygchan.blogspot.com/2012/05/python-how-to-make-clock-timer-in.html
: 내 시계에 대한 코드의 유형을 시도 방향 그래서 나는 그것을 고치려고 노력할 수 있었다. 이후 시간이 주어진 함수를 호출합니다
감사
완벽하게 고정되었습니다. 도와 주셔서 감사합니다! –