Created
October 19, 2019 12:20
-
-
Save gma/87bdd2319cd1ae5f493812a2c7f0384a to your computer and use it in GitHub Desktop.
function for making Python 3 virtual env
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
mkvenv() | |
{ | |
local prompt="${1:-$(basename $(pwd))}" | |
shift | |
command -v deactivate >/dev/null && deactivate | |
[ -d .venv ] && echo "ERROR: .venv exists" 1>&2 && return 1 | |
python3 -m venv .venv --prompt "\[\033[1;34m\]$prompt\[\033[0m\]" $* | |
activate | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment