import random


def partition_int(length, parts):
    """Randomly generate parts integers >0 that sum to length"""
    splits = random.sample(range(1, length), parts -1)
    splits.sort()
    return [b - a for a, b in zip([0] + splits, splits + [length])]