반응형
나는 데이터를 다음과 같이 받는다.
{
"name": "Unknown",
"parent": "Uncategorized",
"uuid": "06335e84-2872-4914-8c5d-3ed07d2a2f16"
},
uuid
를 String
에서 uuid
로 변환해야합니다.
해결 방법
uuid.UUID
에 전달하면됩니다.
import uuid
o = {
"name": "Unknown",
"parent": "Uncategorized",
"uuid": "06335e84-2872-4914-8c5d-3ed07d2a2f16"
}
print uuid.UUID(o['uuid']).hex
참조 페이지 https://stackoverflow.com/questions/15859156
반응형
'파이썬' 카테고리의 다른 글
파이썬 Django에서 필터로 최신 기록 가져 오기 (0) | 2021.01.22 |
---|---|
파이썬 What's the working directory when using IDLE? (0) | 2021.01.22 |
파이썬 Access index of last element in data frame (0) | 2021.01.22 |
파이썬 정규 표현식은 전체 단어와 일치합니다. (0) | 2021.01.22 |
파이썬 ravel () 함수를 사용하기위한 목록에서 배열로 변환 (0) | 2021.01.22 |
댓글