diff options
author | Julien <contact@julienpro.com> | 2023-07-08 23:15:12 +0200 |
---|---|---|
committer | Julien <contact@julienpro.com> | 2023-07-08 23:15:12 +0200 |
commit | 552fbd35323cf915ab08e9571e6351804c1f0f63 (patch) | |
tree | c14e063b0f1b00d3e163c42354b5ab95ffffab3e | |
parent | 96f2538635f55ed7217b714ef504fbbcaa9ccfb0 (diff) |
Allow execution from another directory
-rwxr-xr-x | lidecli.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -54,16 +54,20 @@ def print_commands(args): def read_temporary_variable(index): config = configparser.ConfigParser() - config.read('config.ini') + path = os.path.dirname(__file__) + config_file = "{}/config.ini".format(path) + config.read(config_file) key = 'TMP_RESULT_'+str(index) return config['TMP_STORAGE'][key] def set_temporary_variable(index, value): config = configparser.ConfigParser() - config.read('config.ini') + path = os.path.dirname(__file__) + config_file = "{}/config.ini".format(path) + config.read(config_file) key = 'TMP_RESULT_'+str(index) config['TMP_STORAGE'][key] = value - with open('config.ini','w') as configfile: + with open(config_file, 'w') as configfile: config.write(configfile) def exec_command(args): |