From bd9ba57fca66d99715e1e82ce3ed339f82bd12a6 Mon Sep 17 00:00:00 2001 From: gimpei Date: Sun, 13 Aug 2017 19:02:40 +0900 Subject: update --- weather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'weather.py') diff --git a/weather.py b/weather.py index 52ca691..8a97a5b 100644 --- a/weather.py +++ b/weather.py @@ -13,8 +13,10 @@ import sys from multiprocessing import Process ok = None + +home = os.environ['HOME'] # check the exists of recent prediction -with open('async/weather.txt','r') as f: +with open('{home}/kawaii-term/async/weather.txt'.format(home=home),'r') as f: line = None for line in f: ... @@ -36,7 +38,7 @@ def async_update(): obj = json.loads( raw ) desc = obj['weather'][0]['description'] save = '___'.join( map(str,[int(time.time()), desc] ) ) - os.system('echo {save} >> async/weather.txt'.format( save=save ) ) + os.system('echo {save} >> {home}/kawaii-term/async/weather.txt'.format( save=save, home=home ) ) if ok is not None: p = Process(target=async_update, args=()) -- cgit v1.2.3