diff --git a/lib/python.zsh b/lib/python.zsh index 1eeb65741..f1e507c48 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -3,3 +3,9 @@ function wo() { } alias cdv='cd $WORKON_HOME' + +function cdp () { + cd "$(python -c "import os.path as _, ${1}; \ + print _.dirname(_.realpath(${1}.__file__[:-1]))" + )" +} \ No newline at end of file