[Tutor] socket question
alan.gauld at freenet.co.uk
Tue Sep 13 13:22:22 CEST 2005
> When I receive a 4-bytes integer using socket.recv, it is stored in
> string. How to convert this string to a integer?
Look at the struct module.
Its unpack method takes a format string which defines how the data
should be interpreted.
Have a look at the section at the end of my file handling topic for
some info and examples of usage:
Author of the Learn to Program web tutor
More information about the Tutor