Converting Python’s Bytes Object to a Dictionary using Python

Feedback


Solution:

Simply utilize the module labeled

json

as suggested by @juanpa.arrivillaga.

Here:

import json
d = json.loads(response)

Your decoded dictionary is now represented by the value of

d

.

As mentioned by @juanpa.arrivillaga, there is no necessity to utilize

.decode()

since

json.loads()

is capable of functioning on bytes.

Frequently Asked Questions