Toggle navigation
Toggle navigation
This project
Loading...
Sign in
조수연
/
Find_your_own_personal_color
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
starbucksdolcelatte
2019-05-23 17:29:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
79eb09d603b544f36efb3af238aa47661936bc95
79eb09d6
1 parent
b2bc2f84
get standard from JSON file
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
jsontest.py
jsontest.py
0 → 100644
View file @
79eb09d
import
json
def
get_standard
(
filename
):
with
open
(
filename
,
mode
=
'r'
)
as
f
:
json_data
=
json
.
load
(
f
)
# 아래와 같은 계절별 기준값이 들어갈 리스트
result_list
=
[[[],[]],[[],[]],[[],[]],[[],[]]]
'''
spr[standard_1[skin[R,G,B], hair[R,G,B], eye[R,G,B]],
...
standard_n[skin[R,G,B], hair[R,G,B], eye[R,G,B]]],
smr[standard_1[skin[R,G,B], hair[R,G,B], eye[R,G,B]],
...
standard_n[skin[R,G,B], hair[R,G,B], eye[R,G,B]]],
...
wnt[standard_1[skin[R,G,B], hair[R,G,B], eye[R,G,B]],
...
standard_n[skin[R,G,B], hair[R,G,B], eye[R,G,B]]]]
'''
# iterate over each dictionary in our list
i
=
0
j
=
0
for
season
in
json_data
:
for
std
in
json_data
[
season
]:
for
body_part
in
json_data
[
season
][
std
]:
result_list
[
i
][
j
]
.
append
(
json_data
[
season
][
std
][
body_part
])
j
+=
1
i
+=
1
j
=
0
print
(
result_list
)
# ['Hurzuf', 'Novinki']
get_standard
(
'standard.json'
)
Please
register
or
login
to post a comment