From 362efd041a597cbdcefbd909a211b0bb18168d33 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 23 Aug 2023 00:42:46 +0800 Subject: [PATCH] added flashing : sign --- clock_screensaver2.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clock_screensaver2.py b/clock_screensaver2.py index 3ed7eb4..0245b7e 100644 --- a/clock_screensaver2.py +++ b/clock_screensaver2.py @@ -47,7 +47,7 @@ time_colors = { "Gray": graphics.Color(100,100,100), "Cyan": graphics.Color(0,255,255) } - +colon_visible = False while True: canvas.Clear() @@ -61,6 +61,13 @@ while True: current_time = datetime.now(timezone).strftime("%H:%M %p") else: current_time = datetime.now(timezone).strftime("%H:%M") + + if colon_visible: + current_time = current_time.replace(":", " ") + colon_visible = False + else: + colon_visible = True + current_date = datetime.now(timezone).strftime("%a %d %b %Y") date_width = graphics.DrawText(canvas, font, 0, 0, time_colors[settings['date_color']], current_date.upper())