Python modules on hcil2

From hcil
Revision as of 20:27, 7 June 2013 by Mgubbels (talk | contribs) (Created page with "If you're using Python on hcil2, you should know about the module directory I have set up. To make it all accessible, just add the following to your .bashrc. <code> if...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you're using Python on hcil2, you should know about the module directory I have set up.

To make it all accessible, just add the following to your .bashrc.

   if [ -e '/fs/hcil2/code/modules/python' ]; then
       export PYTHONPATH="/fs/hcil2/code/modules/python2.7"
       export PATH="$PATH:/fs/hcil2/code/modules/python2.7/scripts"
   fi
   if [ -e '/usr/local/python-2.7.1/bin/python2.7' ]; then
       alias python="/usr/local/python-2.7.1/bin/python"
   fi

So far, I've installed: aes - simple AES encryption atom - for working with ATOM feeds BeautifulSoup - HTML/XML parser for screen scraping and code beautification gdata - Google's serverAPI for Docs, Spreadsheets, Calendar, Maps, etc. numpy - data structures for numerical work PIL - Python Imaging Library pylint - syntax checker web - Web.py framework yappy - parser generator (like yacc/bison)

The directory is hcil-writable so you can add others. Instead of the usual install command (python setup.py install) you would use this:

python setup.py install --install-lib=/fs/hcil2/code/modules/python2.7 --install-scripts=/fs/hcil2/code/modules/python2.7/scripts

To use these in a web app that runs as apache, add the following to the top of your main file: import sys; sys.path.insert(0, "/fs/hcil2/code/modules/python2.7")

I set this up a while ago, but since it's grown over time, I thought all should know where it is.

Alex