April 2010


Uncategorized25 Apr 2010 01:28 pm

On your own notebook computers with one central site-packages for your python setup, follow instructions at http://pypi.python.org/pypi/setuptools

One way is to download http://peak.telecommunity.com/dist/ez_setup.py

and run it (i.e., python ez_setup.py)

Then you’ll be able to do

easy_install simplejson

———————————-

on people.ischool.berkeley.edu:

add to ~/.cshrc:

setenv PYTHONPATH ~/lib/python2.5/site-packages

then you can run

source ~/.cshrc

setup your virtual python:

wget http://svn.python.org/projects/sandbox/trunk/setuptools/virtual-python.py
python virtual-python.py

This sets up a custom python environment that you can run from ~/bin

wget http://peak.telecommunity.com/dist/ez_setup.py

~/bin/python ez_setup.py –prefix=~

Now you’re ready to install simplejson

~/bin/easy_install –prefix=~ simplejson

Demo of http://people.ischool.berkeley.edu/~rdhyee/cgi-bin/testsimplejson.py

#!/home/rdhyee/bin/python

import simplejson as json
print “Content-Type: application/json”
print

m = {‘states’:{‘CA’:’California’, ‘NY’:’New York’, ‘MM’:None}, ‘provinces’:{‘ON’:’Ontario’,’BC’:’British Columbia’}}
m_json = json.dumps(m)
print m_json

Optional — to install virtualenv

~/bin/easy_install –prefix=~ virtualenv

Uncategorized21 Apr 2010 11:39 am

A reminder of the schedule:

Day 26 Wed 2010-04-28 Project Presentations I
Day 27 Mon 2010-05-03 Project Presentations II
Day 28 Wed 2010-05-05 Open House

Pick which day you want to present on and let me know.  Presentations are up to 15 minutes.

Written reports are due on Wednesday, May 5 in class.

——-

http://flickrworld.appspot.com/static/gmapflickr.html

I rewrote most of the code in Ch 10 to run using Python on the I School server.  See

http://people.ischool.berkeley.edu/~rdhyee/s10/day24/gmapflickr.html

The proxy code is at http://people.ischool.berkeley.edu/~rdhyee/s10/day24/flickrgeo.py — the proxy runs at http://people.ischool.berkeley.edu/~rdhyee/cgi-bin/s10/day24/flickrgeo.py