def BuildOption(number, payload):
    # option number and length take 2 byte each so the string has to be 4 chars long
    option = "%04x" % (number)          # option number
    option += "%04x" % (len(payload)/2) # payload length, /2 because 2 chars are 1 byte
    option += payload  
    return option
glue option with payload
dataset/ETHPy150Open HenriWahl/dhcpy6d/dhcpy6/Helpers.py/BuildOption