diff options
author | gimpei <gim.kobayashi@gmail.com> | 2017-08-13 19:02:40 +0900 |
---|---|---|
committer | gimpei <gim.kobayashi@gmail.com> | 2017-08-13 19:02:40 +0900 |
commit | bd9ba57fca66d99715e1e82ce3ed339f82bd12a6 (patch) | |
tree | 0b577abe599fec0715e8974a27809c13c16ae1ac /weather.py | |
parent | f7fd72566766b44099d95face242da1427e5e758 (diff) | |
download | kawaii-term-bd9ba57fca66d99715e1e82ce3ed339f82bd12a6.tar.gz |
update
Diffstat (limited to 'weather.py')
-rw-r--r-- | weather.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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=()) |