Skip to content

Instantly share code, notes, and snippets.

@israel-dryer
Created July 31, 2020 18:01
Show Gist options
  • Save israel-dryer/a85a9cfe76341c3b96ad9d1a6d5a9cf7 to your computer and use it in GitHub Desktop.
Save israel-dryer/a85a9cfe76341c3b96ad9d1a6d5a9cf7 to your computer and use it in GitHub Desktop.
Simple clock update for PySimpleGUI
"""
A simple clock demonstration in PySimpleGUI
>> YouTube Comments Response <<
"""
import PySimpleGUI as sg
from datetime import datetime
layout = [[sg.Text(text=datetime.now().strftime('%I:%M:%S'), key='-CLOCK-')]]
window = sg.Window('Clock', layout=layout)
while True:
event, values = window.read(1000)
current = datetime.now().strftime('%I:%M:%S')
window['-CLOCK-'].update(current)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment