Skip to content

Instantly share code, notes, and snippets.

@sirvan3tr
Created May 23, 2022 10:19
Show Gist options
  • Save sirvan3tr/f0199094c131b8087a035e1a078851ba to your computer and use it in GitHub Desktop.
Save sirvan3tr/f0199094c131b8087a035e1a078851ba to your computer and use it in GitHub Desktop.
zshrc commands to create a Python virtual environment (.venv) and create a Python .gitignore at the same time
# Python virtual venv alias
alias activate='test -d venv && source ./venv/bin/activate || echo "No Virtualenv in the current folder"'
make_python_venv() {
echo "Creating .venv environement"
test -d venv && echo "Already exists" || python3 -m venv venv; activate
echo "Fetching .gitignore file"
wget https://raw.githubusercontent.com/sirvan3tr/configs3tr/main/Python.gitignore
mv Python.gitignore .gitignore
echo "Success"
}
alias mkenv=make_python_venv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment