json文件:
test.json
{"512":"4096000","1K:2048000","2K":"1024000","4K":"512000","8K":"256000","16K":"128000","32K":"64000","64k":"32000","128k":"16000","256k":"8000","512k":"4000","1M":"2000","2M":"1000","4M":"500"}
python文件:
test.py
#!/usr/python2.7 import simplejson as json in_srt = open('iotest.json','r').read().strip('\n') print in_srt s = json.loads(in_srt) print s print s.keys() print s['1K']