Add shell function venv to activate python virtual environment

This commit is contained in:
Peter J. Holzer 2017-09-27 09:40:01 +02:00
parent 2c1919752e
commit 5e59c96b35
1 changed files with 10 additions and 0 deletions

10
.zshrc
View File

@ -79,6 +79,16 @@ man () {
command man "$@" command man "$@"
} }
venv() {
for d in venv/"$1" ve/"$1" ~/venv/"$1"
do
if [ -f "$d"/bin/activate ]
then
. "$d"/bin/activate
fi
done
}
source ~/.znewterm source ~/.znewterm
# assume pseudo terminals are from a "safe" terminal # assume pseudo terminals are from a "safe" terminal