socket script from perl -> python

Hrvoje Niksic hniksic at
Thu Feb 7 20:01:15 CET 2008

kettle <Josef.Robert.Novak at> writes:

> # pack $length as a 32-bit network-independent long
> my $len = pack('N', $length);
> the sticking point seems to be the $len variable.

Use len = struct.pack('!L', length) in Python.  See for details.

More information about the Python-list mailing list