| Store | Cart

struct unpack help?

From: Scherer, Bill <Bill...@VerizonWireless.com>
Thu, 11 Jul 2002 09:44:29 -0400 (EDT)
Hello  - 

I'm trying to unpack a struct and I need some help.

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 

	struct.unpack('HH', sampleStructString) 

results in:

	struct.error: unpack str size does not match format

I believe that the first of the two shorts in the sample struct 
string has a decimal value of 1.


TIA, 

Bill

-- 
Bill.Scherer at Verizon Wireless
RHCE 807101044903581

Recent Messages in this Thread
Scherer, Bill Jul 11, 2002 01:44 pm