반응형
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 | 31 |
Tags
- nginx-proxy
- reverse-proxy
- FileSystemError
- Volumes
- AI
- modelfile
- 퍼이썬
- Python
- GGUF
- 핍
- Linux
- 리눅스
- 용량
- capacity
- python3
- IQN
- daemon.json
- python pip
- Save
- path-style
- ollama
- LLM
- 파이썬
- HuggingFace
- error
- pip3 upgrade
- 패키지
- docker
- virtual-hosted-style
- 버전
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 |