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 |
Tags
- max_length
- ncp배포
- epsp
- 백준 1158
- 문제풀이
- 경상국립대학교
- 백준 1158번
- 백준 다리놓기
- 5397
- 그래프 탐색
- NaverCloudPlatform
- linc3.0
- 16953
- ncloud서버
- 고속거듭제곱알고리즘
- lgh
- 1010번: 다리 놓기 (Python)
- 9735번
- Django
- PS
- 백준
- 백준 7576번
- python
- json
- 백준 토마토
- Charfield
- 백준 7576
- 7576번
- 요세푸스 문제
- 다리 놓기
Archives
- Today
- Total
DolphinDash
JSON 파일 열어서 데이터 얻고 이름 수정하기 (Python) 본문
import json
import os
with open(f'열 JSON파일', 'r', encoding='UTF8') as rf:
json_data = json.load(rf)
data = json_data['data']
atributes = data[0]['attributes']
print(atributes)
keywords = []
for j in range(len(atributes)):
keywords.append(atributes[j]['name'])
keyword = ' '.join(keywords)
os.rename('원래 파일 경로', '이름 바꾼 파일 경로')
'개발Log' 카테고리의 다른 글
인코딩 디코딩이 헷갈려서 쓰는 글 ( JavaScript ) (2) | 2023.08.22 |
---|---|
CharField의 max_length는 기준이 뭘까? ( django ) (0) | 2023.08.12 |
JSON 파일 열기, 수정하기 (Python) (0) | 2023.08.03 |