aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2019-03-19 23:00:43 +0000
committerJuan J. Martinez <jjm@usebox.net>2019-03-19 23:00:43 +0000
commit9bb7031e58e02ed5391c16c1fad14f642ee3065a (patch)
treed5f32c5a0be8eff3ec1a643d04c743526676e3a3
parent773b72b6bbae768d18a054309527337695860655 (diff)
downloadz80count-9bb7031e58e02ed5391c16c1fad14f642ee3065a.tar.gz
z80count-9bb7031e58e02ed5391c16c1fad14f642ee3065a.zip
Find the table file on the script directory
-rwxr-xr-xz80count.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/z80count.py b/z80count.py
index 6e5397c..cbaabb0 100755
--- a/z80count.py
+++ b/z80count.py
@@ -27,6 +27,7 @@ import json
import sys
import re
import argparse
+from os import path
def main():
@@ -55,7 +56,8 @@ def main():
in_f = args.infile
out_f = args.outfile
- with open("z80table.json", "rt") as fd:
+ table_file = path.realpath(path.join(path.dirname(__file__), "z80table.json"))
+ with open(table_file, "rt") as fd:
table = json.load(fd)
for i in range(len(table)):