A subclass of pathlib's Path that adds a script_dir() method
Switch branches/tags
Nothing to show
Latest commit 6c61273 Apr 20, 2017 Gigi Sayfan Add TutsPlus article mention to the README file



Provide a a subclass of pathlib's Path that adds a static script_dir() method to Path, which returns the Path to the directory of the calling script. It could have been just a standalone function, but for discoverability reasons it seems better to stick it on top of pathlib's Path.


It's a drop-in replacement to pathlib's Path:

from pathology import Path

print('The script dir is:', Path.script_dir())


This package was developed as sample code for a TutsPlus article. Checkl it out: How to Write, Package and Distribute a Library in Python