struct unpack help?
Erno Kuusela
erno-news at erno.iki.fi
Thu Jul 11 12:57:03 EDT 2002
In article <mailman.1026395600.7294.python-list at python.org>, "Scherer,
Bill" <Bill.Scherer at VerizonWireless.com> writes:
| Here's a sample string of the struct:
| sampleStructString = "_782c1a08_p_void"
| I know that the struct defines only two unsigned shorts. That
| would imply (to me, anyway) a format of 'HH'. But calcsize of
| that is 4, while my string is 16 bytes. So
it appears you have a different definition of a struct than the
struct module. if struct.calcsize('HH') returns 2, then it means
that on your platforms shorts are 2 bytes each.
the "p_void" in your string makes me think it might encode a c pointer
(void *). the characters "782c1a08" might be a machine address,
interpreted as an ascii string containing a hexadecimal number.
-- erno
More information about the Python-list
mailing list