From 03f0f541d42a9a508ba79a418b9231e12e1e7294 Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer Date: Fri, 29 Sep 2023 13:05:54 +0200 Subject: [PATCH] Tweak output --- openweather.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openweather.py b/openweather.py index be672a7..51cb783 100755 --- a/openweather.py +++ b/openweather.py @@ -24,11 +24,19 @@ if x["cod"] != "404": z = x["weather"] weather_description = z[0]["description"] + print() print(Columns([ - Panel(f"[bold]Temperature[/bold]\n[blue]{current_temperature} K", expand=True), - Panel(f"[bold]Atmospheric Pressure[/bold]\n[blue]{current_pressure} hPa", expand=True), - Panel(f"[bold]Humidity[/bold]\n[blue]{current_humidity} %", expand=True), - Panel(f"[bold]Description[/bold]\n[blue]{weather_description}", expand=True) + Panel(f"[blue]{round(current_temperature - 273.15, 2)}°C", + title="[bold]Temperature[/bold]"), + + Panel(f"[blue]{current_pressure}hPa", + title="[bold]Atmospheric Pressure[/bold]"), + + Panel(f"[blue]{current_humidity}%", + title="[bold]Humidity[/bold]"), + + Panel(f"[blue]{weather_description}", + title="[bold]Description[/bold]"), ])) else: