Beginner question: binary data and socket.send

Stephen Hansen apt.shansen at gmail.com
Mon Dec 21 18:49:41 EST 2009


On Mon, Dec 21, 2009 at 3:31 PM, Boris Epel <boep777 at googlemail.com> wrote:
> Hi! Please help with the problem:
> send over TCPIP data packet organized as 6 bytes of identifier,
> integer (LSB) and length of following binary data, binary data
> the clear part:  create socket, connect it, use send, close socket
> the unclear part:  create string with required data to use with send
> what I tried:

You probably want to take a look at the "struct" module to pack your
byte-strings with binary data.

HTH,

--S



More information about the Python-list mailing list