You are looking for this:
>>> import os.path
>>> fullpath="/absolute/path/to/file"
>>> os.path.dirname(fullpath)
'/absolute/path/to'
Related functions:
>>> os.path.basename(fullpath)
'file'
>>> os.path.split(fullpath)
('/absolute/path/to','file')
You are looking for this:
>>> import os.path
>>> fullpath="/absolute/path/to/file"
>>> os.path.dirname(fullpath)
'/absolute/path/to'
Related functions:
>>> os.path.basename(fullpath)
'file'
>>> os.path.split(fullpath)
('/absolute/path/to','file')