1 # Save and resume progress in lightcards
8 dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
12 """Generate hash of stack for name of pickle file"""
13 return hashlib.md5(str([str(x) for x in stra]).encode("utf-8")).hexdigest()
17 """mkdir -p equivalent"""
18 if not os.path.exists(dired):
23 """Write pickle file"""
26 pickle.dump(obj, open(f"{dired}/{name_gen(stra)}.p", "wb"))
31 file = f"{dired}/{name_gen(stra)}.p"
33 if os.path.exists(file):
34 return pickle.load(open(file, "rb"))
40 """Delete pickle file"""
41 file = f"{dired}/{name_gen(stra)}.p"
42 if os.path.exists(file):