""" I wrote this script to illustrate the problem:
'\x1a' hex string gets truncated when read from file
Does anyone know a workaround?
"""
import struct
x = struct.pack('chhh','a', 6668,22,33)
# x is now 'a\x00\x0c\x1a\x16\x00!\x00'
# just to prove that it is working:
print...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.