How To/python/
# -*- coding: utf-8 -*- """ os.path.split(string path) -> typle Split path into dir name and file name. if path ends with / file name part is empty. """ import os print os.path.dirname('abc/def/xyz/pol') #('abc/def/xyz','pol')