From eb1614f81461963df1cd8b0b8d26f7a7bb7250b4 Mon Sep 17 00:00:00 2001 From: Mike Zingman Date: Mon, 7 Dec 2015 22:47:02 -0500 Subject: [PATCH] Make the cwd for execution be the same directory as the .py file --- dmrlink.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dmrlink.py b/dmrlink.py index 16cd2e0..f521c3e 100755 --- a/dmrlink.py +++ b/dmrlink.py @@ -46,6 +46,8 @@ __maintainer__ = 'Cort Buffington, N0MJS' __email__ = 'n0mjs@me.com' __status__ = 'beta' +# Change the current directory to the location of the application +os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', action='store', dest='CFG_FILE', help='/full/path/to/config.file (usually dmrlink.cfg)')