From 11f503d8ce1d153631da0f9d19384efc22774580 Mon Sep 17 00:00:00 2001 From: Maximilian Wagner Date: Tue, 25 Jun 2024 21:20:08 +0200 Subject: [PATCH] remove plus if temp positive --- scripts/weather.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/weather.py b/scripts/weather.py index 0c5e9ad..90e2a4f 100755 --- a/scripts/weather.py +++ b/scripts/weather.py @@ -5,5 +5,7 @@ import sys req = requests.get(f'https://wttr.in/{sys.argv[1]}?format="%t:%c:%C"').text[1:-1].split(':') +req[0] = req[0][1:] if req[0][0] == '+' else req[0] + print('{' + f'"text": "{req[0]} {req[1]}", "tooltip": "", "class": "{req[2]}"' + '}')