> When I receive a 4-bytes integer using socket.recv, it is stored in 
> a
> 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:

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to