Linux and BSD users
If you are using a Linux distribution such as Fedora or Mandrake or other (your choice), or a BSD system such as FreeBSD, you may already have Python installed in your system.
To test whether you have Python installed with your Linux package, you can open a shell program (like Konsole or gnome-terminal) and enter the command python-v as shown below.
$ python-v
Python 2.3.4
Comments
$ is the prompt for the shell. Depending on your operating system settings, it may not be the same as yours, so I only use the $ symbol to represent the prompt.
If you see some version information as shown above, you already have Python installed.
If you get a message like this:
$ python-v
Bash:python:command not found
So you haven't installed Python yet. This is almost impossible, but it is extremely rare to encounter.
In this case, you have two ways to install Python on your system.
Use the package management software that comes with your operating system to install binary packages, such as Fedora Linux yum, Mandrake Linux URPMI, Debian Linux apt-get, FreeBSD, and so on. Note that you need to connect to the Internet with this method.
You can also download a binary package from somewhere else and copy it to your PC for installation.
You can compile Python from the source code and install it. There are compiled instructions on the Web site.
windows® Users
windows® users can access the Python.org/download and download the latest version from the site (the latest version is the 2.3.4 version at the time of writing). It is about 9.4MB in size and is very compact compared to most other languages. The installation process is similar to other Windows software.
Tips
Even if the installer provides you with the option not to check the optional components, you don't have to do any checking! Some components are useful to you, especially the integrated development environment.
Interestingly, about 70% of the Python downloads are from Windows users. Of course, this does not explain the problem, because almost all Linux users have installed the system by default Python.
Using Python in the Windows command line
If you want to invoke Python from the Windows command line, you need to set the path variable correctly first.
For Windows 2000, XP, 2003, click Control Panel-> System-> advanced-> environment variables. In the System variables form, click the variable called path, and then edit the variable to put; C:python23 added to its end. Of course, it's the correct directory name for Python.
For older versions of Windows, add the following line to the file c:autoexec. BAT Medium: path=%path%; C:python23, and then reboot the system. For Windows NT, the Autoexec.nt file is used.
Summarized
For Linux systems, it's possible that you've installed Python in your system. Otherwise, you can install Python via the package management software that comes with your distribution. For Windows systems, installing Python is simply downloading the installer and double-clicking it. From now on, we'll assume that you've installed Python in your system.