An error occurred while loading the file. Please try again.
-
Pierre-Antoine Rouby authored0e8b8c5c
# -*- coding: utf-8 -*-
import pickle
class Serializable():
def __init__(self, filename):
self.filename = filename
@classmethod
def open(cls, filename):
with open(filename, 'rb') as in_file:
me = pickle.load(in_file)
return me
def save(self):
with open(self.filename, 'wb') as out_file:
pickle.dump(self, out_file)