def string_split(s, sub):
    """ Assuming s == a + sub + b, returns a,b """
    if not sub in s:
        msg = 'Substring %r not found in %r.' % (sub, s)
        raise ValueError(msg)
    i = s.index(sub)
    return s[:i], s[i+1:]