def whitespace_split(s, nrsplits=-1):
    """
    Splits a string on whitespace. Very similar to Python's built-in 
    s.split(None, nrsplits), but pads the result with empty strings 
    so that it always returns (nrsplits+1) strings.
    """
    splits = s.split(None, nrsplits)
    if nrsplits >= 0 and len(splits) <= nrsplits:
        splits += [''] * (nrsplits + 1 - len(splits))
    return splits