Irritating bytearray behavior

Grant Edwards grant.b.edwards at gmail.com
Tue Sep 17 10:18:18 EDT 2019


On 2019-09-17, Ian Pilcher <arequipeno at gmail.com> wrote:
> I am using a bytearray to construct a very simple message, that will be
> sent across the network.  The message should always be 20 bytes:
>
>    2 bytes - address family (AF_INET or AF_INET6) - network byte order
>    2 bytes - (padding)
>    4 or 16 bytes - IP address

You probably already know this and have rejected it for some reason,
but the struct module is very useful for this sort of thing...

-- 
Grant Edwards               grant.b.edwards        Yow! I wonder if I should
                                  at               put myself in ESCROW!!
                              gmail.com            




More information about the Python-list mailing list