sending binary data over sockets

Scott David Daniels scott.daniels at acm.org
Mon Jul 3 17:46:48 EDT 2006


thorley at gmail.com wrote:
> Greetings, since there was no reponse to my previous post about an
> existing FastCGI server in python, I've taken to writing my own. (which
> of course I'll share--*if* there's something to share ;)
> 
> My problem now, is that I need to send certain binary data over a
> socket. That is, I want to make some bytes, and stuff them in a TCP
> packet, send them down the pipe, and then listen for a response.

As everyone else has already told you, you have a misconception about
strings and struct and so on.  However, if what you want is mutability
in a pattern, read the array module documentation as well.

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list