Created
March 26, 2021 00:05
-
-
Save okken/d166d194e1cb024d88540e8f75ac4b98 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # stick this in .bashrc or .zshrc | |
| # create, activate, exit | |
| function create { | |
| if [[ $# -gt 0 ]] | |
| then | |
| virtualenv -p py39 venv -q --prompt "($1) " | |
| else | |
| virtualenv -p py39 venv -q | |
| fi | |
| source venv/bin/activate | |
| venv/bin/python -m pip install -U pip | |
| } | |
| function activate { | |
| if [ -d venv ] | |
| then | |
| source venv/bin/activate | |
| else | |
| echo "not in a directory with a venv" | |
| echo "try running create" | |
| fi | |
| } | |
| function exit { | |
| echo "deactivate" | |
| deactivate | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment