cpif = Computer Programming Is Fun!

======================================
OVERVIEW AND INSTALLATION INSTRUCTIONS
======================================

This is the cpif software package that comes with the book
Computer Programming is Fun! by David Handy (c) 2003-2009

This software package contains sample programs, sound and image files, and
useful program modules that are used by the examples in the book. You may
also use these modules and files in your own programs.

Go to http://www.handysoftware.com/cpif/ to see how you can get your own
copy of the book.

See the file LICENSE.txt for the terms and conditions under which this
software may be copied.


Instructions to install on Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(See the main README.txt for instructions for Windows)

Prerequisites
-------------

Do the following numbered steps to prepare to install cpif on your machine.

1. You need to know the root password for your machine.

2. You must have Python 2.5 or greater installed on your machine.

You can run Python to check the version number:
    # python
    Python 2.3.4 (#2, Jul  5 2004, 09:15:05)
    [GCC 3.3.4 (Debian 1:3.3.4-2)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> (type Ctrl-D to exit)

Do whatever is appropriate for your version of Linux (rpm, apt-get, etc.) to
upgrade your Python to version 2.5 or better if necessary. See below if you
need to build and install Python from source instead.

3. You must have the Python distutils and idlelib packages installed. These 
   are meant to be part of Python, but some Linux distributions have split
   them off into separate packages.

To test if you have distutils and idle, run the following:
    # python
    >>> import distutils
    >>> import idlelib
    >>> (type Ctrl-D to exit)
If "import distutils" and "import idlelib" succeed, then you are Ok.
Otherwise, you need to install these packages or build Python from
source.

To install distutils and idle on Debian Linux (for example) do the following:
    # apt-get install python-dev      # gets distutils
    # apt-get install idle            # gets idle

A RedHat 9 user found that he needed to built Python from source, because
the system came with Python 2.2.2 installed by default, and so much was
depending on it that there was no way to upgrade it.

Building Python yourself will get you the full version with distutils and
idle included. The source code and instructions are available at:
http://www.python.org/download/

The RedHat 9 user reported that he had to do the following *before*
compiling for Python to be built properly:

    # apt-get install XFree86-devel
    # apt-get install tkinter

If you build Python from source, make sure that /usr/local/bin comes before
/usr/bin in the PATH, or cpif will get installed to the wrong place, and
your users will run the wrong version of Python.

Installing cpif
---------------

Once you have the correct version of Python installed, with its Tkinter,
idle, and distutils packages, then you need to install the cpif package that
contains the samples that go with the book.

If you have the CD that comes with the book, then copy the file
cpif-*.tar.gz from the CD to your /tmp directory (or other directory of your
choice).

If you don't have the CD, go to http://www.handysoftware.com/cpif/ and click
on the "Download" link. Scroll down to the instructions for Linux users.
Click on the link to download the "source code tarball", which will be a
file named like cpif-x.x.x.tar.gz. Save it in your /tmp directory (or other
directory of your choice).

Run the following commands to unpack the source code tarball:

    cd /tmp
    tar xvfz cpif-x.x.x.tar.gz
    cd cpif-x.x.x/

You are now in the main cpif source directory, which contains this
README-Linux.txt file. Now run this command (as root) to install cpif:

    python setup.py install

You must be careful that the version of Python that you run as root is the
same version that will be run by your students -- the PATH for root is
normally different than the path for regular users.  If you built Python
yourself you may have to explicitly say:

    /usr/local/bin/python setup.py install

This completes the portion of the install that requires the the root
password and the CD-ROM.


After Installation
~~~~~~~~~~~~~~~~~~

Running the "CPIF Welcome" program
----------------------------------

Now have each student using this computer do the following steps:

    Open a command window. Type following command and press Enter:

    cpif-welcome.py

    Make sure that you type it exactly as written above, with no capital
    letters.

    A window will appear titled "CPIF Welcome". Press the Ok button. When
    another window appears telling you that the student files were copied,
    press Ok again.


Starting Python
---------------

Have the students run cpif-idle.py to bring up the Python Shell window, as
described in the "Getting Started" section of the book.

Note: Run cpif-idle.py, not "idle", or else the instructions in the book
might not match what you see on the screen.


Read the Book
~~~~~~~~~~~~~

What is the Python Shell window for? That's what the "Getting Started"
lesson in the book "Computer Programming Is Fun!" explains.  The book goes
on to teach computer programming in a step-by-step manner, starting at the
very beginning level.

Enjoy the software, and buy the book if you haven't done so already!

David Handy <cpif@handysoftware.com>
http://www.handysoftware.com/cpif/
