Skip to content

Instantly share code, notes, and snippets.

@microft
Last active March 31, 2024 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save microft/36e45f5d6020f841a20304045fc9c1f6 to your computer and use it in GitHub Desktop.
Save microft/36e45f5d6020f841a20304045fc9c1f6 to your computer and use it in GitHub Desktop.
zsh functions to create and use python 3 virtualenvs based on the directory name
WORKON_HOME=/home/microft/.virtualenvs
workon(){
cd $1;
source $WORKON_HOME/${PWD##*/}/bin/activate
return 0;
}
mkvenv(){
python3 -m venv $WORKON_HOME/$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment