반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- Save
- error
- virtual-hosted-style
- Volumes
- modelfile
- IQN
- 버전
- capacity
- reverse-proxy
- 용량
- LLM
- daemon.json
- pip3 upgrade
- FileSystemError
- python pip
- Linux
- 리눅스
- Python
- path-style
- nginx-proxy
- 패키지
- GGUF
- HuggingFace
- 핍
- python3
- 파이썬
- docker
- 퍼이썬
- ollama
- AI
Archives
- Today
- Total
chargingport
Python dictionary 저장/불러오기 본문
반응형
import pickle
dict = {'A': 1, 'B': 2, 'C': 3}
# dictionary를 dictionary.pkl에 저장
with open("dictionary.pkl", "wb") as output_file:
pickle.dump(dict, output_file)
# dictionary.pkl을 dictionary로 저장
with open("dictionary.pkl", "rb") as input_file:
newDict = pickle.load(input_file)
print(newDict)
$ python3 main.py
{'A': 1, 'B': 2, 'C': 3}

반응형
'NOTES > PYTHON' 카테고리의 다른 글
| JSON 중복 항목 제거 (1) | 2023.09.18 |
|---|---|
| Python Virtual Environment 가상환경 (0) | 2023.09.11 |
| Python PIP 사용방법 (0) | 2023.09.11 |
| pip3 버전 업그레이드 (0) | 2023.09.07 |
| ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package (0) | 2023.09.05 |