def intToBin(i):
    """ Integer to two bytes """
    # divide in two parts (bytes)
    i1 = i % 256
    i2 = int(i / 256)
    # make string (little endian)
    return i.to_bytes(2, byteorder='little')
def intToBin ( i ) : i1 = i % 256 i2 = int ( i / 256 ) return i . to_bytes ( 2 , byteorder = 'little' )
Integer to two bytes