From 9bb7031e58e02ed5391c16c1fad14f642ee3065a Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 19 Mar 2019 23:00:43 +0000 Subject: Find the table file on the script directory --- z80count.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)): -- cgit v1.2.3