Name

dirname

Synopsis

dirname(path)

Returns the directory part of path, just like os.path.split( path )[0]. For example, os.path.dirname('b/c/d.e') returns 'b/c‘.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.