import struct import sys # We build the content of the file in a byte string first # This lets us calculate the length for the header at the end data = b'' data += b"Sunny.com".ljust(32, b' ') # Merchant ID data += b"B"*32 # Customer ID data += struct.pack("