Commit 204e2a17 authored by Tom Barbieri's avatar Tom Barbieri
Browse files

Ejemplo de uso de reloj/cronometro con pysimplegui

parent a670858e
.DS_Store
\ No newline at end of file
import PySimpleGUI as sg
import datetime
import time
layout = [
[sg.Text(size=(15,1), key='-OUTPUT-')],
[sg.Exit()]
]
window = sg.Window('Ventana').layout(layout)
counter = 0
while True:
event, values = window.read(timeout=10)
# acualizar tiempo cada 10 milesimas de segundo
window['-OUTPUT-'].update(
'{:02d}:{:02d}.{:02d}'.format((counter // 100) // 60, (counter // 100) % 60, counter % 100))
counter += 1
if event is None or event == 'Exit':
break
window.Close()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment