January 5, 2009

Setting up my python development environment

Note to self:
my setup for a python development environment
sketch so far:


use virtualenv wrapper changed mkvirtualenv function to to virtualenvwrapper_bashrc
function mkvirtualenv () {
    verify_workon_home
    (cd "$WORKON_HOME"; virtualenv $*)
    if [ ! -f $WORKON_HOME/$1/bin/postactivate ]
    then
        workon "${@:-1}"
        easy_install ipython
        easy_install pysmell
        wget http://www.eletztrick.de/software/mkvimproject/releases/0.4.2.3/mkvimproject-0.4.2.3.tar.gz
        easy_install mkvimproject-0.4.2.3.tar.gz
        rm mkvimproject-0.4.2.3.tar.gz
        deactivate
        touch $WORKON_HOME/$1/bin/postactivate
        postactivate="$WORKON_HOME/$1/bin/postactivate"
        echo "cd $WORKON_HOME/$1" >> $postactivate 
        echo "export PYTHONPATH=$WORKON_HOME/$1/scr:$PYTHONPATH" >> $postactivate    
        echo "if [ ! -d $WORKON_HOME/$1/src ]" >> $postactivate
        echo "then" >> $postactivate
        echo "    mkdir -p $WORKON_HOME/$1/src" >> $postactivate
        echo "fi" >> $postactivate
        echo "if [ ! -f $WORKON_HOME/$1/$1.vpj ]" >> $postactivate
        echo "then" >> $postactivate
        echo "    mkvimproject -o $1.vpj -s python" >> $postactivate
        echo "fi" >> $postactivate
        echo "if [ ! -f $WORKON_HOME/$1/PYSMELLTAGS ]" >> $postactivate
        echo "then" >> $postactivate
        echo "    pysmell src;" >> $postactivate
        echo "  cd lib/python2.5;" >> $postactivate;
        echo "  pysmell . -x site-packages -o ../../PYSMELLTAGS.stdlib;" >> $postactivate
        echo "  cd ../..;" >> $postactivate 
        echo "fi" >> $postactivate
        echo "pproject -U" >> $postactivate
    fi
    workon "${@:-1}"
}

then create a new virtual env with mkvirtualenv projectName --no-site-packages
this will setup the environment for vim and allow for the use of pysmell omnicompletion
and allows a ipython shell within the environment.

2 comments:

Ernest said...

sorry, this is scary to me

a11ycwj70p said...

Additionally, the maximum wall thickness of the plastic part performs a significant role in determining the amount of material required. The size of Space Heaters channels, the amount of the mildew cavity, the amount of fabric is carefully related to this thickness of the part. Small errors during the process or even the incorrect number of resins can result in huge losses and quality points. It is hence necessary to rigorously perceive the forms of injection molding defects and their causes to be able to} have suitable prevention choices. At the same time, as injection molding is widespread all through the world, it's straightforward to get the human resources to fix in case one thing goes incorrect.