Wednesday, October 28, 2020

Pickle Module in python

 import pickle

#Code For Create File
car=["Audi","BMW","Suzuki"]
file="mycar.pkl"
fileobj=open(file,'wb')
pickle.dump(car,fileobj)
fileobj.close()

#For read file that we create in above code
file="mycar.pkl"
fileobj=open(file,'rb')
mycar=pickle.load(fileobj)
print(mycar)