From 2acbe7afd6443e98f9abffd842ec5b89bf4355e7 Mon Sep 17 00:00:00 2001 From: NCLanceman Date: Thu, 19 Jun 2025 01:18:59 -0500 Subject: [PATCH] working on code portablility --- weather.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weather.py b/weather.py index adbbac1..71dbc71 100644 --- a/weather.py +++ b/weather.py @@ -2,6 +2,10 @@ import requests import math import sys import iconSelector as iconSelect +import os + +currentDirectory = os.getcwd() +CDHardcode = "/home/nclanceman/tools/weather" try: stationName = sys.argv[1] @@ -96,7 +100,8 @@ else: condition = request_json["properties"]["textDescription"] timeOfDay = request_json['properties']['icon'].split("/")[5] weatherIcon = iconSelect.parseDescription(condition) - weatherIconImage = f"/home/nclanceman/tools/weather{iconSelect.imageSelector(weatherIcon, timeOfDay)}" + weatherIconImage = currentDirectory +\ + iconSelect.imageSelector(weatherIcon, timeOfDay) # print(f" \u2601 {condition}, {roundedTemp} F") print( f"{weatherIconImage} {roundedTemp}F")