#!/usr/bin/env python3 from datetime import datetime from nicegui import ui def build_svg() -> str: '''Returns an SVG showing the current time. Original was borrowed from https://de.m.wikipedia.org/wiki/Datei:Station_Clock.svg.''' now = datetime.now() return f''' ''' clock = ui.html().classes('self-center') ui.timer(1, lambda: clock.set_content(build_svg())) ui.run(host='0.0.0.0', port=7860)