Make the cwd for execution be the same directory as the .py file

This commit is contained in:
Mike Zingman 2015-12-07 22:47:02 -05:00
parent 108a9e14d3
commit eb1614f814
1 changed files with 2 additions and 0 deletions

View File

@ -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)')