Skip to content

Instantly share code, notes, and snippets.

@hilios
Created May 21, 2013 19:43
Show Gist options
  • Save hilios/5622613 to your computer and use it in GitHub Desktop.
Save hilios/5622613 to your computer and use it in GitHub Desktop.
Execute shell command getting aware of pythonbrew configuration
# http://joshuawherring.com/blog/?p=2361
source "/path/to/.pythonbrew/etc/bashrc"
VENV=$2
PY=$1
pythonbrew use ${PY}
echo "Using ${PY}"
pythonbrew venv use ${VENV}
echo "Venv ${VENV}"
shift 2
echo "Executing $@ in ${VENV}"
exec "$@"
deactivate
pythonbrew off
sh /path/to/api/runapi 2.7.3 api python /path/to/api/nameofprogram.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment