Binary files-I-Group O2
Binary files-I-Group O2
Main points
o dump()- This method is used to convert (pickling) Python objects for writing data in a
binary file.
dump(data_object, file_object)
e.g pickle.dump(L,f1)
e.g
import pickle
L=[1,"Geetika",'F', 26]
f1=open("mybinary.dat", "wb")
pickle.dump(L,f1)
fileobject.close()
load()-This method is used to load (unpickling) data from a binary file.
Store_object = load(file_object)
e.g. a= pickle.load(f1)