The Python Programming Language

Python is the name of a programming language that is being used in some special applications. I do not yet provide a book about Python, but through the link below you can get Python versions of the programs that are presented in my programming books. This means, for example, that if you want to know how the program Game.java, that is presented in my Java book, can be written with the Python programming language, you can simply click the link below and you'll find a file named Game.py that contains the Python version of the program.

There are about 100 Python programs available. These programs correspond to the about 100 Java programs presented in A Natural Introduction to Computer Programming with Java. The Python versions of the programs contain comments that should help you to get some basic information about the Python programming language. (If you want to get C++ or C# versions of these programs, you can find them via the other link below.)

  • Get the Python programs
  • Links to all example programs
  • Python is a programming language for which you get a free compiler (or interpreter). From www.python.org you can get a file named python-2.4.3.msi, and by executing this file on your (Windows) computer, you can install the Python compiler and documentation related to Python. When I installed the Python compiler, I installed it to folder (directory) D:\Python24. After this I could run the Python program Game.py  in the following way in a command prompt window:

    D:\>cd pythonfiles2

    D:\pythonfiles2>\Python24\python Game.py

     This program is a computer game.
     Please, type in an integer : 1234

     You typed in 1234.
     My number is 1235.
     Sorry, you lost. I won. The game is over.

    D:\pythonfiles2>

    This is not the only way to run Python programs. Please, explore the tools that are installed when above-mentioned .msi file is executed, and you'll probably find easier ways to execute Python programs. It is also possible to execute a .py file by clicking on the file's icon but this usually terminates the program so quickly that you cannot see what it prints.

    You can edit Python programs with the Notepad2 editor which is able to show a Python program with several colors. Instructions for downloading and installing the Notepad2 editor are provided here.

    www.python.org provides a lot of documentation related to Python. Some of these documents are installed to your computer when you install the compiler.
     

     
  • Give feedback, report errors, etc.

  • To www.naturalprogramming.com
    To personal homepage of Kari Laitinen

     

    THE PROGRAMS OF THIS BOOK ARE 
    AVAILABLE AS PYTHON PROGRAMS
     


     
     
     
     
     
     
     
     
     

    Page created: May 30, 2006
    Last modification: June 11, 2006