The first step is to ensure you have Python 3.2 installed on Ubuntu 11.04 – for that check out my article here on how to do that.
Now you can go into the Ubuntu Terminal and grab, extract, and install CherryPy:
$ wget http://download.cherrypy.org/cherrypy/3.2.0/CherryPy-3.2.0.tar.gz $ tar -xvf CherryPy-3.2.0.tar.gz && cd CherryPy-3.2.0/ $ sudo python3.2 setup.py install
To verify that CherryPy installed correctly do this:
$ python3.2 -c "import cherrypy"
If nothing comes back (no errors) then everything is good.
Using the CherryPy tutorial code we can create a file called hello.py and add the following Python code to it:
import cherrypy class HelloWorld: def index(self): return "Hello world!" index.exposed = True cherrypy.quickstart(HelloWorld())
To run this program with CherryPy simply do this:
$ python3.2 hello.py
Browse to this address: http://localhost:8080/
Control-C will stop the server.