[英]how to take json format in python
I have a json 我有一个json
format = [
{
"Deskripsi": "Anda baik dalam Bersikap tegas dan menolak hal yang tidak disukai"
}
]
I wrote this script which prints all of the json text: 我写了这个脚本,打印了所有的json文本:
io = StringIO()
json.dump(format,io)
return io.getvalue()
How can I take the "Anda baik dalam Bersikap tegas dan menolak hal yang tidak disukai"
from the json format? 如何从json格式中"Anda baik dalam Bersikap tegas dan menolak hal yang tidak disukai"
?
First of all, format
is not JSON . 首先, format
不是JSON 。 Is a python list containing a dictionary. 是包含字典的python列表。
You could get what you want by doing: 您可以通过执行以下操作获得所需的信息:
format[0]["Deskripsi"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.