From 171daf88a753d5683dda695ff83013ae90a76809 Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 19 Apr 2021 21:54:00 +0100 Subject: fixed some bugs --- subreddit.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'subreddit.py') diff --git a/subreddit.py b/subreddit.py index e8c37bb..f4eb8fe 100755 --- a/subreddit.py +++ b/subreddit.py @@ -11,7 +11,12 @@ import json import re import os -with open("config.json", "r") as f: +if os.path.split(os.getcwd())[-1] == "onceaday": + configpath = "../config.json" +else: + configpath = "config.json" + +with open(configpath, "r") as f: CONFIG = json.load(f) REDDIT = praw.Reddit(**CONFIG["redditapi"]) -- cgit v1.2.3