mirror of https://gitlab.com/pamhyr/pamhyr2
18 lines
364 B
Python
18 lines
364 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import pickle
|
|
|
|
class Serializable():
|
|
def __init__(self):
|
|
return
|
|
|
|
@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)
|