Killer Web Development

by Marco Laspe

2.1 One editor to rule them all

A text editor is a program to write software source code. It is a bit like Word for computer programms. There are plenty of great text editors and IDEs out there. For the sake of simplicity we will use gedit. It works the same across all operating systems, has good Python and HTML support (e.g. code highlighting) and it's easy to use.

gedit code editor web2py application development

You can download gedit for Windows and OS X:

  1. gedit for Windows
  2. gedit for OS X

On Ubuntu (and most other Linux distros) gedit is already installed. If it is not installed use the package manager of your distro to install it.

After Installation of gedit, go to Edit > Settings in the menu. In the View tab check all checkmarks; in the Editor tab reduce tab width to 4 and again check all checkmarks; close the settings window.

gedit code setting  web2py application development

If you have choosen another editor or an IDE for your development work that is totally fine. But if you are new to programming use gedit, it is a really powerful editor, that is easy to use.

Installing Python (optional)

You don't need a Python installation to use web2py, but it helps if you want to use Python outside of the web2py context.

Go to the download page on Python.org and download the newest Python 2.7.x installer for your architecture (2.7.2 at the ti me of writing) and install it.

Setting the Path Variable on Windows

To make the Python interpreter and gedit available everywhere on your system for you, we have to change the PATH variable. The process is a bit different on different Windows versions.

Be sure to double check that the path variable gets the right value on your system. It could be different than what I have written down. It depends on your system.

Windows 7/8

  1. Select Computer from the Start menu
  2. Choose System Properties from the context menu
  3. Click Advanced system settings > Advanced tab
  4. Click on Environment Variables, under System Variables, find PATH, and click on it.
  5. In the Edit windows, modify PATH by adding C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; as the value.
  6. Reopen Command prompt window, and type in 'python' to check if the 'PATH' variable is set correctly.

Windows XP

  1. Start -> Control Panel -> System -> Advanced
  2. Click on Environment Variables, under System Variables, find PATH, and click on it - if it is not present create a new one.
  3. In the Edit windows, modify PATH by adding C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; as the value.
  4. Close the window.
  5. Reopen Command prompt window, and type in 'python' to check if the 'PATH' variable is set correctly.

Windows Vista

  1. Right click My Computer icon
  2. Choose Properties from the context menu
  3. Click Advanced tab (Advanced system settings link in Vista)
  4. In the Edit windows, modify PATH by adding C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\gedit\bin; as the value.
  5. Reopen Command prompt window, and type in 'python' to check if the 'PATH' variable is set correctly.

Books often read by web2py and Python experts:

Comments

Leave a Reply

Required fields are marked *.