Created
March 18, 2015 22:33
-
-
Save karlcow/73ff8527573ab3cd8ed6 to your computer and use it in GitHub Desktop.
cdp os.path… will put you in the directory of the module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To put in your .bashrd use with example | |
# cdp os | |
# to reach the directory where the os python module is. | |
cdp () { | |
cd "$(python -c "import os.path as _, ${1}; \ | |
print(_.dirname(_.realpath(${1}.__file__[:-1])))" | |
)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment