Writing hex data into a file,fout.write(binascii.unhexlify(''.join(line.split())))