Mike Fletcher
1999-08-09 22:13:15 UTC
Wouldn't it be something like:
'>bbbb' or '!bbbb'
instead (for portability to non-big-endian machines (I'm assuming the packed
representation is supposed to have network byte order))?
Just a thought,
Mike
-----Original Message-----
From: python-list-request at cwi.nl [mailto:python-list-request at cwi.nl]On
Behalf Of Steven D. Majewski
Sent: August 9, 1999 4:50 PM
To: python-list at cwi.nl
Subject: Re: Packing and unpacking IP addresses into 32-bit integers
...
and use either struct.pack or array to coerce it into a binary string:
a = apply( struct.pack, [ 'bbbb' ] + adr )
'>bbbb' or '!bbbb'
instead (for portability to non-big-endian machines (I'm assuming the packed
representation is supposed to have network byte order))?
Just a thought,
Mike
-----Original Message-----
From: python-list-request at cwi.nl [mailto:python-list-request at cwi.nl]On
Behalf Of Steven D. Majewski
Sent: August 9, 1999 4:50 PM
To: python-list at cwi.nl
Subject: Re: Packing and unpacking IP addresses into 32-bit integers
...
and use either struct.pack or array to coerce it into a binary string:
a = apply( struct.pack, [ 'bbbb' ] + adr )