How does Python turn a JSON string to JSON? Need help understanding the process! or Python turns JSON

20 Replies, 1309 Views

`json.loads()` is the way to go, but if you’re working with messy data, you might wanna preprocess the string.

For example, sometimes APIs return JSON with trailing commas or comments—`json.loads()` will choke on those. Tools like `demjson` (third-party) can handle some non-standard JSON, but it’s slower.

Stick with `json.loads()` for most cases, though.

Messages In This Thread



Users browsing this thread: 1 Guest(s)