Python for everybody | 3 | How to install Python on Mac and Windows

Python Tutorial 3
Installing Python

Python must be installed before you can run Python program codes on your computer, and for you to follow through the hands-on exercises in this course.

In addition, you will need to install a source code editor.

In this course, we will use Sublime Text as our source code editor.

So let’s get started!

Python Is Free


Python is a free and open-source software that you can download.

The screens, screen prompts, and steps for installing Python differ between Windows and Mac OS.

And differs between different web browsers.

And future versions of Python may again have different displays.

So only the essential steps for Windows will be covered.

How To Install Python On Mac And Windows

First of all, open up your computer’s web browser and type in the URL

          https://www.python.org/downloads/

Next, click on the latest available version of Python.

Please note that in this course we use Python 3 in all the examples and exercises, so download Python 3 and NOT Python 2.

Next, click on Save when prompted to Save.

How to install Python on Mac and Windows | 2

Next, go to the download folder, look for the “.exe” file starting with the word “python”, and click on it.

Next, click on Run when prompted to Run.

How to install Python on Mac and Windows | 3

Next, an installation screen will appear.

Please REMEMBER to TICK the box Add Python 3 to PATH.

How to install Python on Mac and Windows | 4

This is very important, because only with “Python 3 added to path”, then you can run Python from any directory on your computer.

Finally, after you have TICKED the box, click “Install Now” and Python will be installed onto your computer.

Once the installation is successful a screen will be shown to indicate “setup successful”.

How to install Python on Mac and Windows | 5

Click close to finish.

Summary Of Steps For How To Install Python On Mac And Windows

You may see slightly different screens and screen prompts, so it is important to know that the basic steps for installation are :

  • Open up your web browser
  • Type the Python download URL
  • Look for the Python 3 download button
  • Click on download
  • Save download file
  • Look for the download file
  • Run download file
  • Please REMEMBER to TICK the box Add Python 3 to PATH
  • Click to install

How To Start Up Python

After you have installed Python on your computer, to run Python you need to go to the PowerShell on Windows or Terminal on Mac OS.

For Windows, press the Windows key and the r key simultaneously and you will be prompted with Open.

Type powershell, and click OK.

To run Python, type

          python

And you are now into the Python Interpreter.

To exit from the Python Interpreter, type

          exit()

To exit from the PowerShell, type

          exit

How To Install Sublime Text On Mac And Windows

Now that you know how to install Python on Mac and Windows, you will need to also install a source code editor because Python is simply an interpreter that takes your Python source codes and converts them to machine codes that the computer can then run.

A source code editor allows you to type your code and save it as a Python source code file just like a word processor software like Microsoft Word which allows you to type your document and save it as a Microsoft Word document.

Sublime Text Or Notepad++

In this course, we will use Sublime Text as our source code editor.

Sublime Text is simple to use.

It has all the nice features like auto-completion and find and replace functions so typing and editing your source codes becomes very easy.

It is free to download but will prompt you to optionally purchase a license for continuous usage.

A very good alternative to Sublime Text is Notepad++ but then it is not available for those on the Mac OS.

Notepad++ is a free and open-source software.

If you are on Windows, do download and use Notepad++ if you need a completely free and open-source software that you can use.

To install Sublime Text.

First of all, open up your computer’s web browser and type in the URL

          https://www.sublimetext.com/

How to install Python on Mac and Windows | 7

Next, click on the latest available version of Sublime Text.

Next, click on Save when prompted to Save.

How to install Python on Mac and Windows | 8

Next, go to the download folder, look for the “.exe” file starting with the word “sublime text setup”, and click on it.

Next, click on Run when prompted to Run.

Next, a series of installation screens will appear.

Finally, click Next and Install when prompted.

Once the installation is successful, a screen will be shown to indicate “setup successful”.

Click Finish.

Summary Of Steps On How To Install Sublime Text On Mac And Windows

You may see slightly different screens and screen prompts, so it is important to know that the basic steps for installation are :

  • Open up your web browser
  • Type the Sublime Text URL
  • Look for the Sublime Text download button
  • Click on download
  • Save download file
  • Look for the download file
  • Run download file
  • Click on Next and Install to install

How To Run Your Python Program

After you use a source code editor to type in your Python program source code and save it, you can then run your Python program by going into Windows PowerShell and typing :

          python pythonprg.py

where pythonprg.py is the source code file name that you have saved under.

Note that Python recognizes files with the file extension .py as Python program source code files, so always save your Python source code files with the .py extension.

Python will not run files that are saved under any other file extension.

What Is Not Covered In This Course


This course will not delve into teaching a complete course on how to use source code editing software, Python frameworks, or Integrated Development Environments, also called IDEs for short, because this course’s most important objective is to ensure that the learner learns about programming in Python.
 
There are plenty of online resources available that the learner can easily find online and will be able to understand once the learner has a good grasp of the essentials that this course aims to achieve.

Watch my online Python course for a different learning experience.

>> Click here to watch my online Python course at Udemy