- Python Dictionary 에서 key 값만 얻기
feed_datas = json.load(open(feed_data_filepath, 'r'))
# print feed_datas
# keys
keys = [key for key in feed_datas]
print keys - 위의 예제는 json 형식으로 저장된 파일에서 dict() 형식으로 읽은 데이터의 key 값들만 얻는 Example 이다.
'Python > Examples' 카테고리의 다른 글
Python | Examples | 이미지 파일 binary 로 read 후 web browser 에서 data 받아서 보여주기 (0) | 2016.03.03 |
---|---|
Python | Examples | Python code 에서 bash 명령 실행, command 실행 (0) | 2016.03.03 |
Python | Examples | BeautifulSoup | convert NavigableString to string (0) | 2016.03.02 |
Python | Examples | String to datetime (0) | 2016.03.02 |
Python | Example | convert (encoding/decoding) URL Unicode to UTF-8 characters (0) | 2016.02.26 |