Może np. tak
import wx, threading
from datetime import datetime
class MainWindow(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(250,100))
def ShowWatch():
try:
threading.Timer(1, ShowWatch).start()
time = datetime.now().strftime("%H:%M:%S")
watch_st.SetLabel(time)
except:
pass
watch_st = wx.StaticText(self, label="...")
ShowWatch()
self.Show(True)
def OnExit(self, e):
self.Destroy()
self.Close(True)
if __name__ == "__main__":
app = wx.App(False)
window = MainWindow(None, "Zegar")
app.MainLoop()