[issue11344] Add height argument to os.path.dirname()

Antoine Pitrou report at bugs.python.org
Fri Mar 4 23:04:12 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

As for use cases, I have used it quite commonly in test scripts in order to find out the base directory of the source tree (and/or other resources such as data files).

e.g.:

basepath = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11344>
_______________________________________


More information about the Python-bugs-list mailing list