需要提取projectID,我的最终输出是1868117666669。
'{
"code":"ok",
"job":{
"config":{
"progress":{
"message":"Reading 2014-03-03__12-57-01-PM.xml",
"percent":107,
"maxmemory":954,
"memory":667
},
"projectID":1868117666669,
# other stuff
}
}
}'
答案 0 :(得分:0)
你可以尝试
>>> a = '{"code":"ok","job":{"config":{"progress":{"message":"Reading 2014-03-03__12-57-01-PM.xml","percent":107, "maxmemory":954,"memory":667},"projectID":1868117666669}}}'
>>> json.loads(a)['job']['config']['projectID']
1868117666669