for i in range(0, len(w)):
    if(i==(len(w)-1)):
        f2.write("0x" + binascii.hexlify(w[i]))
        continue