First python file:-
class Person:
def __init__(self, name, age):
self.a = name
self.b = age
def show(self):
print(self.a)
print(self.b)
import pickle
Myob = Person()
with open('class.pickle', 'wb') as pick:
pickle.dump(Myob, pick)
# with open('class.pickle', 'rb') as PickFile:
# Get_dat = pickle.load(PickFile)
#
# Get_dat.show()
Second File:-
import pickle
with open('class.pickle', 'rb') as PickFile:
Get_dat = pickle.load(PickFile)
Get_dat.show()
But if I put 2nd file code to 1st file it work correctly(now in comment)
Please help me