you should not use while loop. you need to make a function and call it periodically
read more about keeping track of time
read more about keeping track of time
import pyglet import time pyglet.font.add_file('digital-7.ttf') window = pyglet.window.Window() window.set_fullscreen(False) label = pyglet.text.Label('', font_name='Digital-7', font_size=50, x=window.width//2, y=window.height//2, anchor_x='center', anchor_y='center') def update_clock(dt): label.text = time.strftime('%H:%M:%S %P') pyglet.clock.schedule_interval(update_clock, 0.1) # this will update 10 times a second, you may change that @window.event def on_draw(): window.clear() label.draw() pyglet.app.run()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs