From b3d1e350e3f2806462eec59636c131f611917c9b Mon Sep 17 00:00:00 2001 From: Frisk Date: Wed, 13 Feb 2019 00:10:54 +0100 Subject: [PATCH] Close when opened as module --- rcgcdw.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rcgcdw.py b/rcgcdw.py index ad4aa89..d05c4dc 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -26,6 +26,10 @@ from collections import defaultdict, Counter from urllib.parse import quote_plus from html.parser import HTMLParser +if __name__ != "__main__": + logging.critical("The file is being executed as a module. Please execute the script using the console.") + sys.exit(1) + try: with open("settings.json") as sfile: settings = json.load(sfile)