When I try to write a specific byte (letter 'p') in a writable buffer using pack_into the result is a corrupted data:
The answer should be '\x30'. What I'm doing wrong?
Code:
>>> from ctypes import create_string_buffer
>>> from struct import pack_into
>>> test = create_string_buffer(1)
>>> pack_into("B", test, 0, 48)
>>> print repr(test.raw)
'0'
Comment