[b]"How does Python turn a JSON string to JSON? Need help understanding the process!"[/b] or [b]"Python turns JSON

20 Replies, 1112 Views

Not a dumb question at all! `json.loads()` is the standard way python turns json string to json (or rather, a dict).

If you’re unsure about the JSON’s validity, paste it into [JSON Formatter](https://jsonformatter.curiousconcept.com/) first.

Also, pro tip: if your JSON has weird formatting (like single quotes instead of double), `ast.literal_eval()` can sometimes help, but `json.loads()` is still the safer bet.

Messages In This Thread



Users browsing this thread: 1 Guest(s)