How to Use json.dumps Without Newlines for Compact Output?

16 Replies, 2071 Views

Thanks, everyone! I tried the `indent=None` and `separators=(',', ':')` combo, and it worked like a charm. I was using an IDE that was auto-formatting the output, so that’s why I thought it wasn’t working.

Quick follow-up: Is there a way to prevent IDEs from auto-formatting JSON output? Or do I just have to disable that feature manually?

Also, big shoutout to the tools you guys suggested—super helpful for debugging!

Messages In This Thread



Users browsing this thread: 1 Guest(s)