def splitFilename(fn):
    """Split filename into base and extension (base+ext = filename)."""
    if '.' in fn:
        base, ext = fn.rsplit('.', 1)
    else:
        ext = ''
        base = fn
    return base, ext