Skip to content

Instantly share code, notes, and snippets.

@ines
Last active February 28, 2021 19:42
Show Gist options
  • Save ines/c00535e6ac294750ddba95fd24a77db5 to your computer and use it in GitHub Desktop.
Save ines/c00535e6ac294750ddba95fd24a77db5 to your computer and use it in GitHub Desktop.

Revisions

  1. ines revised this gist Nov 10, 2020. 1 changed file with 11 additions and 8 deletions.
    19 changes: 11 additions & 8 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,14 @@
    function venv {
    if [ ! -d ".env" ]; then
    python -m venv .env
    echo -e "\x1b[38;5;2m✔ Created virtualenv .env\x1b[0m"
    default_envdir=".env"
    envdir=${1:-$default_envdir}

    if [ ! -d $envdir ]; then
    python -m venv $envdir
    pip install ipython black flake8
    echo -e "\x1b[38;5;2m✔ Created virtualenv $envdir\x1b[0m"
    fi
    source .env/bin/activate
    source $envdir/bin/activate
    export PYTHONPATH=`pwd`
    echo -e "\x1b[38;5;2m✔ Activated virtualenv .env\x1b[0m"
    }

    alias venv="venv"
    echo -e "\x1b[38;5;2m✔ Activated virtualenv $envdir\x1b[0m"
    python --version
    }
  2. ines created this gist Nov 25, 2019.
    11 changes: 11 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function venv {
    if [ ! -d ".env" ]; then
    python -m venv .env
    echo -e "\x1b[38;5;2m✔ Created virtualenv .env\x1b[0m"
    fi
    source .env/bin/activate
    export PYTHONPATH=`pwd`
    echo -e "\x1b[38;5;2m✔ Activated virtualenv .env\x1b[0m"
    }

    alias venv="venv"