Skip to content

Instantly share code, notes, and snippets.

@perchouli
Created October 1, 2016 15:34
Show Gist options
  • Save perchouli/a2b4c315bb4eaa43e575b96c0a97f5c2 to your computer and use it in GitHub Desktop.
Save perchouli/a2b4c315bb4eaa43e575b96c0a97f5c2 to your computer and use it in GitHub Desktop.
frameworkpython.py(matplotlib+virtualenv/0
#!/bin/bash
# frameworkpython -m IPython --matplotlib
# what real Python executable to use
PYVER=2.7
PATHTOPYTHON=/usr/local/bin/
PYTHON=${PATHTOPYTHON}python${PYVER}
# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print(os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..')))"`
# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment