Serialization:
Variable from memory into a process that can be stored or transferred
Called pickling in Python, also called serialization,marshalling,flattening in other languages, etc.
Deserialization (unpickling):
Variable contents re-read from serialized object into memory
ImportPickled= Dict (name='Bob', Age=20, score=88) Pickle.dumps (d)#ResultsB'\x80\x03}q\x00 (x\x03\x00\x00\x00ageq\x01k\x14x\x05\x00\x00\x00scoreq\x02kxx\x04\x00\x00\x00nameq\x03x\x03\ X00\x00\x00bobq\x04u.'" "The Pickle.dumps () method serializes any object into a bytes and then writes the bytes to the file. Or use another method Pickle.dump () to serialize the object directly and write to a file-like . Object" "F= Open ('Dump.txt','WB') Pickle.dump (d, f) f.close ()#deserialization, Pickle.loads ()/load ()f = open ('Dump.txt','RB') d=pickle.load (f) f.close () d{' Age': 20,'score': 88,'name':'Bob'}
Python, serialization