Oh man, I feel you on this. The default formatting in `json.dumps` can be a pain. Your fix works great, but if you want to avoid messing with separators, you can also use `json.dumps(my_dict, indent=None)`. It’s a bit less verbose and still gives you json dumps without newlines in a dictionary.
How to Use json.dumps Without Newlines in a Dictionary for Compact Output?
22 Replies, 1976 Views| Messages In This Thread |
|
How to Use json.dumps Without Newlines in a Dictionary for Compact Output? - by - 12-02-2025, 06:25 AM
|
Users browsing this thread: 1 Guest(s)
