V
V
Vsevolod html2020-09-13 13:18:43
Python
Vsevolod html, 2020-09-13 13:18:43

How to split json array using python?

I have a bot that receives a JSON array via API:

{"Warnings":null,"Errors":null,"Result":null,"Stats":"Absolute running time: 0.5 sec, cpu time: 0.59 sec, memory peak: 47 Mb, absolute service time: 0,69 sec","Files":null,"NotLoggedIn":false}

I need to split it to get only errors and result, but since I'm getting this as a POST request, it splits oddly, who knows!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2020-09-13
@dimonchik2013

import json
d = json.loads(t)
print(d['Errors'], d['Result'])

J
Jek, 2020-09-13
@jotrib

there is a module for working with json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question