import pickle # pickle 이라는 모듈 importprofile_file = open("profile.pickle", "wb")# w : write, 쓰기 위한 목적# b : binary, pickle을 쓰기 위해선 반드시 정의# pickle에서는 따로 encoding하지 않는다.profile = {"이름":"박명수", "나이":30, "취미":["축구","골프","코딩"]}print(profile)pickle.dump(profile, profile_file)# profile에 있는 정보를 file에 저장profile_file.close()