def int_padding(length, val, direction=">"):
    """Formats value giving it left zeros padding up to a total length of 'length'"""
    return '{0:0{direction}{fill}}'.format(val, direction=direction, fill=length)