Archives Feb. 13, 2016

Python basic usage of pickle

Python pickle

import pickle

#dumps(object) :Object serialization
lista=["john","levi","kate"]
listb=pickle.dumps(lista)
#print listb

#loads(string) :The object is restored, and the object type is restored to the original format.
listc=pickle.loads(listb)
#print listc

#dump(object,file) :To store objects in a file.
group1=("cat","is","kkkk")
f1=file ...

Continue reading

Previous day

Feb. 11, 2016

Next day

Feb. 18, 2016

Archives