Skip to content

Instantly share code, notes, and snippets.

@FSX
Created July 9, 2012 13:54
Show Gist options
  • Save FSX/3076710 to your computer and use it in GitHub Desktop.
Save FSX/3076710 to your computer and use it in GitHub Desktop.
Some helper functions for Virtualenv.
#!/bin/bash
# Add to ~/.bashrc
# source /path/to/virtualenv-funcs.sh
# Usage: command virtualenv-name python-version
# Examples:
# mkenv momoko 2
# workon momoko 2
# delenv momoko 2
mkenv () {
virtualenv --prompt="($1:$2) " -p "python$2" "/home/$(whoami)/.env/$1-$2"
}
workon () {
source "/home/$(whoami)/.env/$1-$2/bin/activate"
}
delenv () {
rm -rf "/home/$(whoami)/.env/$1-$2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment