python的字典装为json
import jsondic = {
'str': 'this is a string',
'list': ,
'sub_dic': {
'sub_str': 'this is sub str',
'sub_list':
},
'end': 'end'
}
a = json.dumps(dic)
print a
输出结果: {"sub_dic": {"sub_str": "this is sub str", "sub_list": }, "end": "end", "list": , "str": "this is a string"}
页:
[1]