Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Can someone explain what ".after" means?
#1
So, I'm writing a tkinter GUI, and it's all going pretty well. I'm new to python, and most of my coding knowledge comes from Excel VBA.

So, I've got a label on my GUI that shows the current time. It was some code I found on the internet, that I was able to apply to my application, but was wondering what exactly the ".after" syntax means and is doing. Can someone explain it in simple English for a newb? Thanks.

    def clock_set(self):
        new_time = datetime.datetime.now()        
        new_time = new_time.strftime('%m/%d/%Y       %H:%M:%S')
        if new_time != self.time_now:
            self.time_now = new_time
            self.curr_time["text"] = self.time_now
#THIS LINE
        self.curr_time.after(200, self.clock_set)
Quote
#2
it means to execute clock_set after 200 ms
p_hobbs likes this post
Quote
#3
Thank you.
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)