pickling1 Serialization, pickling - 직렬화 pickle pickle은 python object를 가져와서 문자열표현으로 변환한다 pickling(serialization) : object -> bytes unpickling(deserialization) : bytes -> object >>> import pickle >>> class Rectangle: ... def __init__(self, width, height): ... self.width=width ... self.height = height ... self.area = width * height ... >>> rect = Rectangle(10, 20) >>> type(rect) # pickling >>> a=pickle.dumps(rect) >>> a b'\x80\x03c__main.. 2020. 10. 7. 이전 1 다음