From 0f4933bb61927b5d3177a635ff40fbe1fd10bdbd Mon Sep 17 00:00:00 2001 From: Trivernis Date: Tue, 6 Aug 2019 00:32:21 +0200 Subject: [PATCH] Fixed config file not being found - fixed #5 by setting the directory for the config file to the scripts directory --- riddle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/riddle.py b/riddle.py index f9de30c..eb52aa5 100644 --- a/riddle.py +++ b/riddle.py @@ -238,7 +238,8 @@ def main(): If the --zip flag is set, the images will be downloaded in a .cache directory and then compressed. """ options, subreddits = parser_init() - with open('config.yaml', 'r') as file: # loads the config.yaml file + config_fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.yaml') + with open(config_fname, 'r') as file: # loads the config.yaml file try: settings = yaml.safe_load(file) except yaml.YAMLError as err: