Commit 976f5c63 authored by Adam Blank's avatar Adam Blank
Browse files

setup mystery.py

parent 8814bf42
No related merge requests found
Showing with 39 additions and 0 deletions
+39 -0
from ref import f, g, h, i, j, k
import importlib
import sys
import requests
def get(x):
version = ''.join(sys.version.split(" ")[0].split(".")[:-1])
result = requests.get(
f'https://gitlab.caltech.edu/blank/mysterypy/-/raw/master/{x}.cpython-{version}.pyc')
with open(f'reference/{x}.pyc', 'wb') as f:
f.write(result.content)
cnt = 0
def load(x):
global cnt
try:
spec = importlib.util.spec_from_file_location(x, f"reference/{x}.pyc")
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
except FileNotFoundError:
if cnt == 0:
cnt += 1
get(x)
return load(x)
cnt = 0
return None
cnt = 0
return mod
secret = load('secret')
f = secret.f
g = secret.g
h = secret.h
i = secret.i
j = secret.j
k = secret.k
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment