An Introduction to Python Programming - Part 00

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@amos1969·
0.000 HBD
An Introduction to Python Programming - Part 00
# Part 00 - Getting Python Installed

## Overview

There are a number of different incarnations of Python, but the vast majority of users make use of the one which is downloadable from [python.org][1]. (Sometimes this is known as CPython to distinguish it from other versions.) If you are a beginner this is the one you need to use as other versions are there for special use cases by advanced users.

![python_org_website.png](https://steemitimages.com/DQmThstGjyzP3r7xCBN6UMbwVDk5dA1EBPhYGn3AbaNRSMf/python_org_website.png)

## Installation

Depending on which operating system you are using, you will have to do different things to get Python to install on your system. What we do need to do however is to make sure that we install Python 3. Python 2 is still in use, in a lot of places, but it is rapidly approaching its' end of life, an announcement was made last year that all support for Python 2 will cease as of 2020 and that all projects need to have moved to Python 3 by that point. The only reason that you would currently, choose to use Python 2 is if you were working on a pre-existing code base which was written in Python 2, for all other use cases you should choose to use Python 3.

### Linux

You may not realise it but your operating system probably has a version of Python already installed. Currently, the package management system on Debian based systems (Debian, Ubuntu and Mint for instance) uses Python 2 for various tasks. Whichever flavour of Linux you are using you will need to install the correct packages via the package manager. On Mint I needed to install the **python3** package and the **idle3** packages, but it is worth checking online to see what is recommended for your particular version of Linux.

### Windows

There is an installer for windows, make sure you download the appropriate one, at the time of writing this is Python 3.6 but it may be newer by the time you read this. Run it and make sure to tick the box about adding Python to the System Path as this will save a lot of time later on.

### Mac OS X

There is an installer for Mac OS X, that can be downloaded from the Python website, whether you have to make sure to do anything specific to make it install as expected should be easy to discover using Google. There appear to be some extra steps involved, but as I don't have a Mac to test on I can't comment on their efficacy. 

## Does it Work?

Once you've installed Python 3, find the entry for Idle (or Idle3) in your Start Menu or equivalent. This should open up the Python Interactive Shell, which will have some details of the Python version you are running and then three chevrons:

```python
>>>
```    
    
which denote the prompt for you to type in a Python command. (Note this is not where we will write our programs, but it is where we will interact with them, and where bugs will be reported)

![idle.png](https://steemitimages.com/DQmRaX8dCES8wtUJvQNvBJfmNgY4yFzWzM8icN6Zbg7HQ7Q/idle.png)

On the same line as the chevrons, type the following, exactly as it is shown here:

```python
print("Hello Steemit!")
```
    
![idle-and-print.png](https://steemitimages.com/DQmWVjvxdPxKiMn3dhZCvMi44ohQAW2Lw68LivLrwVYwy9D/idle-and-print.png)

Then hit enter and you should see the text that was between the quote marks displayed on its' own on a new line.

![idle-and-print-with-output.png](https://steemitimages.com/DQmdwFjmjwr1CaD3MVzCwS5wzWF1QNigvaXkdVcsdmpEVPR/idle-and-print-with-output.png)

Congratulations! You've just written your very first Python Program. You can play about with altering the text found between the quote marks and rerunning the code, to alter the outputs.

That's it for this first tutorial. Keep an eye open for more parts over the next few days.

---

My name is Dave Ames. I've been a teacher for 25 years and for the last few of those I've been teaching both children and other adults, especially teachers to program in a variety of environments, but mostly Python.

I'm intending this to be the first in an ongoing series of Introductory Python Programming Tutorials, that are small enough to be easily digestible.



[1]: https://www.python.org/
👍 , , , , , , , , , , , , ,