일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Windows
- Flask
- format
- judge
- Database
- Paper
- Converting
- LLM
- docker
- Mac
- GitLab
- CUDA
- Python
- Package
- list
- DB
- TORCH
- pandas
- file
- Linux
- evaluation
- pytorch
- PostgreSQL
- AI
- KAKAO
- Laravel
- enV
- git
- numpy
- Container
- Today
- Total
목록json (2)
Daily Develope
읽기 문자열 import json my_json_data = f'{"data01" : "value01", "data02" : "value02"}' json_obj:dict = json.loads(my_json_data) print(json_obj.get("data01")) # output = value01 파일 import json my_json_file = "/my/json/file/path.json" json_file = open(my_json_file, "r") json_obj = json.load(json_file) 쓰기 UTF-8 인코딩 import json ### case1) 일반적인 json 출력 >> 포맷 그대로 json으로 변형하면 오류 발생 json_normal = {'my':'json..
flask에서 데이터 읽기사용자가 데이터를 싣어보내는 방법이 다양하기에, 규격(유형)에 맞는 데이터 읽기 방법을 구현해야한다.샘플코드- Get 요청 : request.args 로 데이터 전달- Post 요청 : request.form 으로 데이터 전달- 입력 유형(format)에 따라 데이터 구분 가능 (request.content_type)from flask import request#...@sample.route('/', methods=['GET', 'POST'])def sampleAPI():# ... contentType = request.content_type # 또는 contentType = request.headers.get('Content-Type') args = None ..