def int2bytes(number):

    if not (type(number) is types.LongType or type(number) is types.IntType):
        raise TypeError("You must pass a long or an int")

    string = ""

    while number > 0:
        string = "%s%s" % (byte(number & 0xFF), string)
        number /= 256
    
    return string
Converts a number to a string of bytes
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/rsa/_version133.py/int2bytes