aboutsummaryrefslogtreecommitdiff
path: root/weather.py
diff options
context:
space:
mode:
authorGravatar gimpei <gim.kobayashi@gmail.com> 2017-08-13 19:02:40 +0900
committerGravatar gimpei <gim.kobayashi@gmail.com> 2017-08-13 19:02:40 +0900
commitbd9ba57fca66d99715e1e82ce3ed339f82bd12a6 (patch)
tree0b577abe599fec0715e8974a27809c13c16ae1ac /weather.py
parentf7fd72566766b44099d95face242da1427e5e758 (diff)
downloadkawaii-term-bd9ba57fca66d99715e1e82ce3ed339f82bd12a6.tar.gz
update
Diffstat (limited to 'weather.py')
-rw-r--r--weather.py6
1 files changed, 4 insertions, 2 deletions
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=())