My first “apply” call

After many years of using Python, I finally had to use the apply function.

I need to find the path name of a file underneath it’s parent. Yep, it’s confusing. Here is the code:

def findName(fpath,folder):

    fsplit=fpath.splitall()

    parentSplit=folder.splitall()

    startJoin=len(parentSplit)
    return apply(os.path.join,fsplit[startJoin:])

Leave a Reply

You must be logged in to post a comment.