From a22a4650a597e6ff0d882c8b2862b79b9fbd181d Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Mon, 14 Nov 2016 07:54:59 +0900 Subject: [PATCH] Use json.dumps to print --- electrumx_rpc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/electrumx_rpc.py b/electrumx_rpc.py index f7f05e1..4806e26 100755 --- a/electrumx_rpc.py +++ b/electrumx_rpc.py @@ -13,7 +13,6 @@ import argparse import asyncio import json -import pprint from functools import partial from os import environ @@ -67,7 +66,7 @@ class RPCClient(asyncio.Protocol): '{:,d}'.format(error_count), time_fmt(time))) else: - pprint.pprint(result, indent=4) + print(json.dumps(result, indent=4, sort_keys=True)) def main(): '''Send the RPC command to the server and print the result.'''