# Helpful for txid byte ordering weirdness. from sys import stdin, stdout from binascii import a2b_hex, b2a_hex while True: stdout.write('> ') stdout.flush() line = stdin.readline() if not line: break stdout.write(b2a_hex(a2b_hex(line.strip())[::-1]) + '\n')