Skip to content

Instantly share code, notes, and snippets.

@karlcow
Created March 18, 2015 22:33
Show Gist options
  • Save karlcow/73ff8527573ab3cd8ed6 to your computer and use it in GitHub Desktop.
Save karlcow/73ff8527573ab3cd8ed6 to your computer and use it in GitHub Desktop.
cdp os.path… will put you in the directory of the module.
# 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