T
T
TheOriginFara2020-10-08 15:45:44
Python
TheOriginFara, 2020-10-08 15:45:44

How to Parse received python Json response?

I set the status.get method in the vk api.
Printed the request.
I get the answer: {'text': 'User Status'}
how to get just User Status without {"text:"}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TheOriginFara, 2020-10-09
@TheOriginFara

Did it like this: print (status.get ('text'))
thanks everyone.

S
Sergey Karbivnichy, 2020-10-08
@hottabxp

import json

s = '''{
"response": {
"text": "Статус юзера"
}
}'''

j = json.loads(s)

print(j['response']['text'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question