4259 links
  • Arnaud's links
  • Home
  • RSS Feed
  • Tag cloud
  • Login
search: tag:zsh tag:python tag:venv tag:nomarkdown — newest first
  • Auto activate and deactivate python venv using zsh - DEV Community

    python_venv() {
    MYVENV=./venv
    # when you cd into a folder that contains $MYVENV
    [[ -d $MYVENV ]] && source $MYVENV/bin/activate > /dev/null 2>&1
    # when you cd into a folder that doesn't
    [[ ! -d $MYVENV ]] && deactivate > /dev/null 2>&1
    }
    autoload -U add-zsh-hook
    add-zsh-hook chpwd python_venv

    May 20, 2022 - permalink - https://dev.to/moniquelive/auto-activate-and-deactivate-python-venv-using-zsh-4dlm
    nomarkdown python venv zsh