This note explains how to use a text editor and command window to write and test Python scripts. Once a program (script) is working reasonably correctly, it can be used by others by clicking on its icon. But development and testing must be done within a command window. (If you try to test a Python program by clicking on its icon and the program generates an error, the answer window appears and disappears almost immediately, leaving you no time to read the error messages.)
Python works best when used with a Unix-like OS (or within Cygwin on Windows), but you can use it within a Windows Command-Prompt window, too. Read the web page, Using Python from a command window if you are a Windows user.
If you use Cygwin on Windows, it is simplest to run Python within a Cygwin window; just verify that Python is included in your Cygwin installation. (Type which python or just python to see. If not, return to http://www.cygwin.com/ and click on the ``Install or Update Now'' link to add Python to your installation.)
If you use Mac OS-X or Linux, start a command window and type which python or python to see if Python can be started from a command window. (This should work!) If this fails to locate Python, and if you are certain you have installed it, then you must locate python.exe on your computer and use the set PATH command to add the directory path to python.exe to your OS search path.
Python 2.6 (#1, May 18 2007, 07:40:45) Type "help", "copyright", "credits" or "license" for more information. >>>You are ready to go. Here is a simple development methodology for Python scripts:
python test.pyThis loads the Python interpreter, which in turn loads test.py and parses and performs its commands. The results, including errors, are displayed in the command window.