Saturday

Python Web Programming with CherryPy

Python v2.7 64-bit Web Programming with CherryPy v3.2.3 64-bit

Download and install Python v2.7.8 64-bit (Python Interpreter) from
https://www.python.org/downloads/windows/

Download and install PyScripter v2.5.3 64-bit (Python IDE) from
https://code.google.com/p/pyscripter/downloads/list

Download and install pip-1.5.6.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip

Download and install setuptools-5.8.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

Download and install CherryPy-3.2.3.win-amd64.exe from
https://bitbucket.org/cherrypy/cherrypy/downloads/CherryPy-3.2.3.win-amd64.exe

Download and install pywin32‑219.win‑amd64‑py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32

Download and install simplejson-3.6.4.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#simplejson

Add the below two paths to the Windows OS environment variables path:
C:\Python27\Scripts
C:\Python27

Open PyScripter Python IDE

Type the following in the PyScripter Python Interpreter console window to check if the correct cherrypy version has been installed:
>>> import cherrypy
>>> cherrypy.__version__
'3.2.3'
>>>

Type the following in the PyScripter File Editor window:
{
import cherrypy

class HelloWorld(object):
    def index(self):
        return "Hello, World!"
    index.exposed = True

cherrypy.quickstart(HelloWorld())
}
Click on the {Toolbar > Play button}

Open the browser and point at http://127.0.0.1:8080 to see the web page output.

Click on the {PyScripter IDE > Toolbar > Stop button}

Open the .py file at
C:\Python27\Lib\site-packages\cherrypy\tutorial\tut02_expose_methods.py
Click on the {Toolbar > Play button}

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...