def save(self, obj): with open('PicklePersistence', 'wb') as pickle_file: pickle.dump(obj, pickle_file)