Last active
November 21, 2023 18:09
-
-
Save naanadr/23f885785e62d27ac05d6a72a1d1b94c to your computer and use it in GitHub Desktop.
Python env shortcuts
This file contains 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
# Python Env utils | |
# Add this follow lines in your .zshrc or .bashrc | |
export WORKON_HOME=~/envs | |
# eg: $ envcreate env_name | |
envcreate() { | |
NAME=$1 | |
python -m venv $VENV_HOME/${NAME} | |
} | |
# eg: $envactivate env_name | |
envactivate() { | |
NAME=$1 | |
source $VENV_HOME/${NAME}/bin/activate | |
} | |
# eg: envlist | |
envlist() { | |
cd $VENV_HOME; for i in $(ls -d */); do echo ${i}; done; cd -; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment