write unsigned integer 32 bits to socket
larry.bates at websafe.com`
Sun Jul 27 22:01:05 EDT 2008
rkmr.em at gmail.com wrote:
> i want to send unsigned 32 bit integer to socket, and looking for
> something equivalent to this method...
> is there such method / library available in python?!
> this is as far as i have gotten along
>>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
You will need to use struct module to build the 4 byte value and then send it.
Something like (not tested):
us32bit = struct.pack("I", value)
More information about the Python-list