X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/37d9d91c89b12b4c559f9e0ef10420acd1531c50..336ac17d74ed5b34b4a2c1f8a773dbb99dacaa72:/owm.py?ds=sidebyside diff --git a/owm.py b/owm.py index d42ebed..f8d6ccb 100755 --- a/owm.py +++ b/owm.py @@ -14,6 +14,7 @@ import os import csv import datetime import math +import sys baseurl = 'http://api.openweathermap.org/data/2.5/weather' debug = False @@ -94,6 +95,7 @@ def main(configfile): config.read(configfile) apikey = config.get('openweathermap', 'apikey') cityid = config.get('openweathermap', 'cityid') + csvfile = config.get("openweathermap", 'csvfilename') weather_raw = getweather(apikey, cityid) if debug: @@ -106,7 +108,7 @@ def main(configfile): # write to db # write to csv - write_csv(config.get("openweathermap", 'csvfilename'), weather) + write_csv(os.path.expanduser(csvfile), weather) if __name__ == '__main__':