일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Excel
- ubuntu
- 유니티
- 리눅스
- mssql
- flutter
- Unity
- python
- PyQt5
- ASP
- PyQt
- pandas
- 날짜
- PER
- swift
- 다이어트
- sqlite
- port
- MS-SQL
- MySQL
- IOS
- javascript
- Linux
- 함수
- 맛집
- urllib
- GIT
- node.js
- 라즈베리파이
- tensorflow
목록JSON (5)
아미(아름다운미소)
json은 URL요청시 입출력 데이터로 많이 활용됩니다. 예제) import json import urllib.request url = "http://www.test.com" # URL d = {'name': '테스트', 'birth': '0703', 'age': 47} params = json.dumps(d).encode("utf-8") # encode: 문자열을 바이트로 변환 req = urllib.request.Request(url, data=params, headers={'content-type': 'application/json'}) response = urllib.request.urlopen(req) print(response.read().decode('utf8')) # decode: 바이트를..
json은 URL요청시 입출력 데이터로 많이 활용합니다. 예제) import json import urllib.request url = "http://www.naver.com" # URL d = {'name': '유키공', 'birth': '0703', 'age': 47} params = json.dumps(d).encode("utf-8") # encode: 문자열을 바이트로 변환 req = urllib.request.Request(url, data=params, headers={'content-type': 'application/json'}) response = urllib.request.urlopen(req) print(response.read().decode('utf8')) # decode: 바이트..
asp에서 json 텍스트를 받아서 파싱 데이터 처리 asp 에서 json 형태의 텍스트를 받아서 처리하는 샘플입니다. 예를들어서 아래와 같은 json 텍스트를 여러레코드를 배열형태로 넘어왔을때, 이를 파싱해서 데이터를 처리할 수 있는 형태로 처리하도록 하겠습니다. [ {"name" : "홍길동", "age" : "25"}, {"name" : "선동렬", "age" : "32"}, {"name" : "박찬호", "age" : "48"} ] 먼저 json 모듈을 다운로드 받아서 적당한 위치에 파일을 위치하도록 합니다. Dim jsonText jsonText = jsonText & vbcrlf & "[" jsonText = jsonText & vbcrlf & " {""name"" : ""홍길동"", ""ag..
1. JSONJSON은 JavaScript Object Notation의 약자로서 JavaScript 문법에 영향을 받아 개발된 Lightweight한 데이타 표현 방식입니다. JSON은 데이타를 교환하는 한 포맷으로서 그 단순함과 유연함 때문에 널리 사용되고 있습니다. 특히 웹 브라우져와 웹서버 사이에 데이타를 교환하는데 많이 사용되고 있습니다. 가장 많이 사용되는 JSON 포맷은 Key-Value Pair의 컬렉션입니다. Python은 기본적으로 JSON 표준 라이브러리(json)를 제공하고 있는데, "import json" 을 사용하여 JSON 라이브러리를 사용할 수 있습니다. (주: Python 2.6 이상). JSON 라이브러리를 사용하면, Python 타입의 Object를 JSON 문자열로 변..
- Swift 2 func convertStringToDictionary(text: String) -> [String:AnyObject]? { if let data = text.dataUsingEncoding(NSUTF8StringEncoding) { do { return try NSJSONSerialization.JSONObjectWithData(data, options: []) as? [String:AnyObject] } catch let error as NSError { print(error) } } return nil } let str = "{\"name\":\"James\"}" let result = convertStringToDictionary(str) - Swift 3 func convert..