From 5d9c83ed369afd1a29b72fd8e24ff25a4a4d1b7c Mon Sep 17 00:00:00 2001 From: phm3 Date: Sat, 12 Aug 2017 19:37:16 +0000 Subject: [PATCH] fixed path, to be able to run from aliases --- w.py | 6 ++++-- wstations.json | 0 2 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 w.py mode change 100644 => 100755 wstations.json diff --git a/w.py b/w.py old mode 100644 new mode 100755 index 88694f3..566cec8 --- a/w.py +++ b/w.py @@ -35,9 +35,11 @@ else: s2s = sys.argv[1] +script_dir = os.path.dirname(__file__) +rel_path="wstations.json" +abs_file_path = os.path.join(script_dir, rel_path) - -with open('wstations.json') as data_file: +with open(abs_file_path) as data_file: data = json.load(data_file) diff --git a/wstations.json b/wstations.json old mode 100644 new mode 100755