Before you learn how to program, you need to first download and install a copy of Python on your computer. This tutorial will walk you through that process. These instructions are for installing Python 3 onto a computer running Windows 8 using the stock Internet Explorer browser that comes bundled with the operating system. Note that this process should be identical or very similar if you are running another version of Windows, such as Windows 7 or 10, or a different browser such as Chrome or Firefox.
- Firstly, navigate to the Python downloads page here, using your browser.
Python downloads page in Internet Explorer.
On the downloads page you are presented with the option of downloading the latest version of Python 2 or Python 3 via the two large yellow buttons. We will be using Python 3 in this series of tutorials. So click on the yellow button on the left to download the Windows installer.
- After clicking on the left download button, Internet Explorer will display a pop-up at the bottom of the window. It gives you the options to run, save or cancel. Select the run option to execute the web installer.
Internet Explorer download pop-up.
- After pressing the run button, Internet Explorer will firstly scan the file for viruses, then it will download and run it. This will result in the dialog box, shown below, to pop-up onto your screen.
Python installer application.
Before we click on Install Now, you need to ensure that you’ve checked the Add Python 3.5 to PATH option at the bottom of the dialog box.
Ensure option to add Python to the PATH is checked.
Checking this option automatically configures your system so that you can run Python through your terminal without any hassles.
- Now, hover your mouse on the Install Now option and click on it. The setup program will cause Windows to present a dialog box asking if you want to allow the program to make changes to your computer. Press yes to continue with the installation process. When the installation is complete, the setup program will present this success message to you:
Successful installation message.
You have successfully installed Python! Click on the close button to dismiss the window.
- Python comes bundled with an interactive shell application. This is an environment where you can write Python code, execute it, and immediately see the results of the code you’ve written. To test that we’ve successfully installed Python and everything is working perfectly, we’re going open this shell program and execute one line of code.
Search for “IDLE” in your applications and execute the program named IDLE (Python 3.5 32-bit). This is the shell we’re going to be working in. The decimal number immediately after the name Python tells you the version of Python you downloaded. It may be different if you’re viewing this tutorial after subsequent releases have been made by the Python developers. Running IDLE will present you with the shell window like the one displayed below:
Python interactive shell.
- Type out the following statement in the shell and press Enter:
>>> print(‘Hello world!’)
This line of Python code tells the shell to print out the phrase “Hello world!” (Note that we don’t type out the three “>” characters that preceded the statement. That’s just a convention we use in the tutorials, along with the this font style, to indicate that this is a line of code in the shell). Python will respond by displaying the message Hello world! in blue font below the line of code you write.
Executing your first line of Python code!
Congratulations! You have not only downloaded and installed Python successfully, but you’ve also executed your first line of Python code.
Comment with your views on this article in the comments section below, and follow Hyperion Hub developments in the future if you’d like to see more articles like these for the South African market. Find out more about HyperionDev’s Python Software Developer course.