Step 1: Installing Python
Python is an open-source programming language which can be freely downloaded in the
website of Python Software Foundation.
Installing Python in Windows
To install Python in Windows, you must first download the installation package of your
preferred version. This is the link to the different installation packages for Windows.
https://www.python.org/downloads/
On the landing page, you will be asked to select the version you want to download. There
are TWO HIGHLIGHTED VERSIONS:
1. the latest version of Python 3, Python 3.5.1
2. the latest version of Python 2, Python 2.7.11.
If you’re looking for an older release, scroll further down the page to find links to other versions.
Which version should I use?
Python 2 is the older version and was published in late 2000. Python 3 was released in late
2008 to address and amend intrinsic design flaws of previous versions of the language. It
is regarded as the future of Python and is the version of the language that is currently in
development. If you want to read more about it’s differences and which one you should
use you can read about it on <Wiki.Python>.
PLEASE NOTE
This book uses version 3.5.2 of Python.
Installing Python in Mac
If you’re using a Mac, you can download the installation package from this link:
https://www.python.org/downloads/mac-osx/
Running the Installation file
After completing the download step, you can install Python by clicking on the
downloaded .exe file. Setup is automatic. Standard installation includes IDLE, pip, and
documentation.
Starting Python
IDLE is the integrated environment that you can use to write and run your programs in.
Both IDLE and command line interface is installed when you install Python.
Figure 1. Once you install Python into your computer both IDLE and command line
interface are installed.
IDLE versus the command line interface (CLI)
IDLE
IDLE offers a more advanced interface with many options for working with Python. You
can use it in the same way that you would use a command line and more. As an integrated
environment, it offers its own text editor which is easily accessible by clicking on a menu
item. Moreover, it has editing options which make writing programs or simply typing
codes more efficient.
Figure 2. IDLE’ s interface.
The Command Line Interface (CLI)
The command line is useful for trying out lines of codes.
Figure 3. CLI’s interface.
Different ways to access Python’s command line
There are different ways to access Python’s command line or IDLE depending on the
operating system installed on your machine:
If you’re using Windows
You can start the Python command line by clicking on its icon or menu item on the Start
menu.
You may also go to the folder containing the shortcut or the installed files and click on the
Python command line.
If you’re using GNU/Linux, UNIX, and Mac OS systems
You have to run the Terminal Tool and enter the Python command to start your session.