Starting up

The binary distributions of web2py for Microsoft Windows or Apple OS X come packaged with the Python 2.7 interpreter built into the distribution file itself.

You can start it on Windows with the following command (type at the DOS prompt):

  1. web2py.exe -S welcome

On Apple OS X, enter the following command type in a Terminal window (assuming you’re in the same folder as web2py.app):

  1. ./web2py.app/Contents/MacOS/web2py -S welcome

On a Linux or other Unix box, chances are that you have Python already installed. If so, at a shell prompt type:

  1. python web2py.py -S welcome

If you do not have Python 2.7 or Python 3.5+ already installed, you will have to download and install it before running web2py from source.

The -S welcome command line option instructs web2py to run the interactive shell as if the commands were executed in a controller for the welcome application, the web2py scaffolding application. This exposes almost all web2py classes, objects and functions to you. This is the only difference between the web2py interactive command line and the normal Python command line.

The admin interface also provides a web-based shell for each application. You can access the one for the “welcome” application at.

  1. http://127.0.0.1:8000/admin/shell/index/welcome

You can try all the examples in this chapter using the normal shell or the web-based shell.