From 14d1ec042c894180efaf17060bb246b15861b720 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 14 Jun 2014 17:08:29 +0200 Subject: [PATCH] Handy wrapper around bpython --- .bash_aliases | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 42cb842..e9e866f 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -46,3 +46,14 @@ function fuck() { echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo fi } + +#20140614 wrapper around bpython to load the virtualenv's python path +bpython() { + if test -n "$VIRTUAL_ENV" + then + PYTHONPATH="$(python -c 'import sys; print ":".join(sys.path)')" \ + command bpython "$@" + else + command bpython "$@" + fi +}