1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Rep Power

    [Python 3.x + Tkinter] Clock not Work, Help Needed!

    Hey Python Programmers...

    I try to create an clock like program in python and tkinter... but the time don't update
    the seconds in my label... or reather, the seconds give still the same numbers on my
    label in tkinter and python 3.x...

    This is my script, written in pyScripter, Python 3.x...

    from datetime import datetime
    from tkinter import *
    root = Tk()
    now = datetime.now()
    l = Label(root, text = int(now.second), foreground = 'white', background = 'black')
    l.pack(fill = X, side = TOP)
    If you don't know about whats wrong... run my script and see whats happend in my
    clock.... the seconds (i get only seconds called in my code) get still the same time (or
    numbers are only the same numbers as you start my app)....

    Can anyone correct my code, just the time are updated in numbers like an digital clock...
    My time numbers don't leap further in seconds....

    Can anyone help me ?...., thanks for help,
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Does this answer help? https://stackoverflow.com/questions/...e-after-method
    Where that program is to display a random character every 5 seconds you would instead display whatever part of the time that interests you.
    Use the datetime module in an interactive session until you figure out how to format the time in a most pleasing way.
    Also, please use much larger fonts. My eyesight is punk, my pixels many.

    font=('times', 40)
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo