Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating a clock on a notepad tab
    text
    copied!<p>I'm making an application through Python and one of the tabs I'm creating is to show the current times: local and GMT. When I start the program, it gives me the time at which the program was started. I was wondering if there was a way to update the times so that I can have the actual time on the application. I tried this type of code for my clocks: <a href="http://ygchan.blogspot.com/2012/05/python-how-to-make-clock-timer-in.html" rel="nofollow">http://ygchan.blogspot.com/2012/05/python-how-to-make-clock-timer-in.html</a></p> <p>This is what I have for my application so far:</p> <pre><code> 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() </code></pre> <p>It would be appreciated if someone could help me, or even set me in the right direction so I could try to fix it myself.</p> <p>Thanks </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload