def int2str(num,l):
    """
    Given an integer num and desired length l, returns the str(num)
    with appended leading zeroes to match the size l.
    """
    if len(str(num))<l:
        return (l-len(str(num)))*'0'+str(num)
    else:
        return str(num)