1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env python # converts raw bytes on input to hex couples on input. import sys while True: byte = sys.stdin.read(1) if len(byte) < 1: sys.exit(0) sys.stdout.write('%02x' % ord(byte))