When sending data using the
socket module, the data needs to be a string containing the raw byte data. Have a look at the Python
struct module for packing Python integer/float values into raw byte data. The following example shows how to generate raw byte data from 2 integer values:
Code:
import struct
data = struct.pack('ii',value1,value2)