Skip to content

Instantly share code, notes, and snippets.

@sevas
Created November 3, 2010 15:53
Show Gist options
  • Save sevas/661253 to your computer and use it in GitHub Desktop.
Save sevas/661253 to your computer and use it in GitHub Desktop.
export OLD_PATH=$PATH
# switching functions
select_epd62()
{
echo "Setting environment for EPD 6.2 (Python 2.6)"
PATH="/Library/Frameworks/Python.framework/Versions/6.2/bin:${OLD_PATH}"
export PATH
}
select_macpython26()
{
echo "Setting environment for MacPython 2.6"
PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${OLD_PATH}"
export PATH
}
select_system_python26()
{
echo "Setting environment for System Python 2.6"
PATH="/System/Library/Frameworks/Python.framework/Versions/2.6/bin/:${OLD_PATH}"
export PATH
}
## virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /Library/Frameworks/Python.framework/Versions/2.6/bin/virtualenvwrapper.sh
## cd to module directory
cdp()
{
cd "$(python -c "import os.path as _, ${1}; print _.dirname(_.realpath(${1}.__file__[:-1]))")"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment