import pickle
class A:
def __init__(self, item):
self.item = item
b = 5
if __name__ == "__main__":
a = A("Salut")
print(a, a.b, a.item)
with open("pickle_save.p", "wb") as f:
pickle.dump(a, f)
b = 0
with open("pickle_save.p", "rb") as f:
b = pickle.load(f)
print(b, b.b, b.item)
print(a == b)