From aaa6c245e18546c51045e777417a05d5f7b48ee9 Mon Sep 17 00:00:00 2001 From: blank <blank@caltech.edu> Date: Sun, 3 Nov 2024 18:50:08 -0800 Subject: [PATCH] try now --- e1/cracker.py | 2 +- e1/driver.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 e1/driver.py diff --git a/e1/cracker.py b/e1/cracker.py index f3daf00..d673fd2 100644 --- a/e1/cracker.py +++ b/e1/cracker.py @@ -1,4 +1,4 @@ import time -import checker +from driver import checker print(checker.check("abcd")) diff --git a/e1/driver.py b/e1/driver.py new file mode 100644 index 0000000..5aaf42f --- /dev/null +++ b/e1/driver.py @@ -0,0 +1,21 @@ +import requests +import sys +import importlib +version = ''.join(sys.version.split(" ")[0].split(".")[:-1]) +result = requests.get( + f'https://gitlab.caltech.edu/cs1-24fa/lecture-code/-/raw/master/e1/checker/checker.cpython-{version}.pyc') +with open('checker.pyc', 'wb') as f: + f.write(result.content) + + +def load(x): + spec = importlib.util.spec_from_file_location( + x, f"checker.pyc") + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + +checker = load('checker') + +check = checker.check -- GitLab