본문 바로가기
IT/[파이썬]

[파이썬] pickle 로 변수 저장하기

by Coffee With Me 2020. 11. 21.

import pickle

data = ['a','b','c']

 

# Save pickle

with open("filename.pickle","wb") as fw:

    pickle.dump(data, fw)

 

# Load pickle

with open("filename.pickle","rb") as fr:

    data = pickle.load(fr)

print(data)