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
- Django
- 1010번: 다리 놓기 (Python)
- Charfield
- 경상국립대학교
- NaverCloudPlatform
- 백준 7576번
- 백준 1158
- 다리 놓기
- 백준 토마토
- 그래프 탐색
- json
- max_length
- 5397
- 16953
- 고속거듭제곱알고리즘
- ncloud서버
- 7576번
- 요세푸스 문제
- lgh
- 9735번
- ncp배포
- 백준 1158번
- 백준 다리놓기
- epsp
- 백준 7576
- 문제풀이
- PS
- 백준
- python
- linc3.0
Archives
- Today
- Total
목록json (2)
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
2023. 8. 3. 17:10
JSON 파일 열기, 수정하기 (Python)
import json with open(f'json파일위치', 'r', encoding='UTF8') as rf: json_data = json.load(rf) #데이터 수정 예시 data = json_data['data'] video_name = json_data['metaData']["name"] # print(json_data) new_data_set = {} new_data_set['videoName'] = video_name new_data_set['data'] = data with open(f'json파일위치', 'w', encoding='UTF8') as wf: json.dump(new_data_set, wf, indent="\t", ensure_ascii=False) ensure_ascii..
개발Log
2023. 8. 3. 16:56