import sys c = 0 with open(sys.argv[1], "rb") as f: while True: b = f.read(1) if len(b) == 0: break ws = " " if c < 31 else "\n" c = (c + 1) % 32 print(f"{b[0]:02}{ws}", end="")