Installing and getting started with Python on Linux (Ubuntu)
Lately, within the last year, I've been hearing a lot about Python in one form or another. The things I've heard or read are good of course. Among the things read and heard, the top three are that it is portable, fast and flexible.
Currently I don't have too much time to spend exploring Python, however I am still naturally curious about Python as you are. So I decided to install it and write about the ease of the installation and write a small program using Python.
I hope this benefits others by providing a visual glance of what installing Python entails and how quick you can get a program up and running.
My System Environment:
Ubuntu Linux (Version 9 / Jaunty)
Before I begin to demonstrate the installation process via screenshots, I want you all to know that you can accomplish the same task (probably) via the Add/Remove Programs interface in Ubuntu. Simply click on applications and by default, it is the last option at the bottom. Then search for Python, click on the check box and click the apply button to allow Ubuntu's installation of Python.
The method below takes you through the installation option as if you downloaded the package from Python's site and installed it via the terminal.
- Download the tarball or bzipped tarball file from Python.
- Unpack the contents to your Documents or any directory of your choice (you can do this by right clicking on the file and using the context menu to unpack the contents, or more savvy users can use their terminals.
- Open up your terminal window (Applications > Accessories > Terminal)
- Navigate to the directory where you unpacked the contents of your Python package

- Make sure you are in the top level directory of the folder that you just finished unpacking. When you type ls in your terminal, you should be seeing the same files and folders (more or less depending on the version you are installing)

- Then type "./configure" without the quotes

- Next you'll need to wait a few minutes while it finishes it's process. You should be seeing lots of scrolling text beginning with the word checking in every line. If so, you are on the right track.

- After it completes, type sudo su (in Ubuntu or simply su in other distros) to get the root. Then type "make install" without the quotes to complete the installation of Python on Linux.

- You should get the following text that shows the process is complete

- Now you are ready to begin programming in Python. To do this, let's clear our Terminal screen by typing "clear" without the quotes. Your terminal should then clear. Next type the word "python" without quotes. You should get the following message:
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> - Begin by typing v1 = 3 [Press Enter] v2 = 7 [Press Enter] print v1 + v2 [Press Enter]
This should give you the output "10" on your terminal. - The variables are still in place so now lets type the following:
print v1, ' + ', v2, ' = ', v1 + v2
That should give you the following output:
3 + 7 = 10
>>> - To exit out you can type quit(). The screenshot below depicts what you should be seeing in your terminal.

Although I am an fond of C#, I must comment on how neat Python is. First of all, I did not have to declare the variable types for v1 or v2. In the program they were used as they were supposed to be used, as integers. I also read somewhere that you can mix number types (e.g. add integers and double types) something that is not always done in C# through implicit conversion but rather has to be done via casting. Also, this Python program was pretty simple to code. There was minimal text, no semicolon's at the end of a line and less syntax to worry about. A similar program written in C# would take more lines of code and syntax rules. I have a favorable impression of Python so far. It may be a programming language I get into in the future.