[yz@test-4 yz]$ python3 >>> import json >>> s = '{"x": "123", "y": "456"}' >>> r = json.loads(s) >>> j = json.dumps(r, indent=None, ensure_ascii=False) >>> print(j) {"x": "123", "y": "456"} >>> j = json.dumps(r, indent=None, ensure_ascii=False, separators=(',',':')) >>> print(j) {"x":"123","y":"456"} >>> j = json.dumps(r, indent=None, ensure_ascii=False, separators=(', ',': ')) >>> print(j) {"x": "123", "y": "456"}