From 06ecaf916842c597928b9714a206c3f12589d7a5 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 24 Aug 2017 18:20:22 +0200 Subject: [PATCH] print() function for Python 3 --- code/get-utxo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/get-utxo.py b/code/get-utxo.py index 285aba4c..ebce0083 100644 --- a/code/get-utxo.py +++ b/code/get-utxo.py @@ -25,4 +25,7 @@ resp = requests.get('https://blockchain.info/unspent?active=%s' % address) utxo_set = json.loads(resp.text)["unspent_outputs"] for utxo in utxo_set: - print "%s:%d - %ld Satoshis" % (utxo['tx_hash'], utxo['tx_output_n'], utxo['value']) + print("%s:%d - %ld Satoshis" % (utxo['tx_hash'], utxo['tx_output_n'], + utxo['value'])) + # Or try... + # print("{tx_hash}:{tx_output_n} - {value} Satoshis".format(**utxo))