Skip to main content

Setup and Installation

Downloading Python

Getting Python installed and ready on your computer is the first step towards becoming a Python programmer. Follow these instructions to install Python and set up your coding environment.

Installation Guide

Verify Installation
Run the following in your terminal: python --version

You should see output like: Python 3.9.1

Setting Up Your Development Environment

There are many, many different IDEs for Python, each with its pros and cons. We recommend using Visual Studio Code as your IDE for Python development because it is lightweight(doesn't take much up resources) and is completely free and open source, making it easy to find additional functionalities and tutorials online.

You can find the installer for your appropriate OS here

And you can find the guide for installing Python into VSC here

Python Web Environments

For those who prefer not to install an IDE on their machine or are looking for a quick way to start coding in Python, web-based Python IDEs offer a convenient alternative. These IDEs don't require any installation and provide the tools and resources to write, run, and debug Python code. There are several popular web-based Python environments out there, but we recommend that you use Google Colab. It is completely free and ready to use immediately- all you need is a Google account.

Here's how to use Google Colab:

Head over to Google Colab, where you'll be prompted to log into your Google account if you haven't already.

Now you'll see the Welcome to Colab! page that is already written in the Google Colab environment. You can read this for more info on Google Colab, or you can go create a new Colab page by heading to File->New notebook

A new tab will open with a fresh notebook. Click on a cell to begin typing your Python code. You can see the various commands on how to run the code by heading to the Runtime tab at the top. You can click on the +code tab at the top to add more code cells or the +text tab to add non-code information, such as text or images.

Your current notebook will automatically be saved to your Google Drive, and you can find where the colab file is saved by heading to File->Locate in Drive

Now that you have Python installed, let's write your first Python script!

Writing Your First Python Script

One of the first programs programmers learn is the simple "Hello, World!" script, which displays "Hello, World!" on the screen. Let's try doing this in your chosen IDE environment.

Using an installed IDE such as Visual Studio Code:

  • Open your IDE and create a new file.
  • Save the file with a .py extension, for example, hello_world.py.
  • Type the following Python code:
print("Hello, World!")
  • Run the script by using the IDE's run feature or by opening a terminal (or command prompt) and typing python hello_world.py. You should see Hello, World! printed out in the console.

Using Google Colab

  • If you haven't already, create a new notebook in Google Colab, or run it on an existing Colab notebook.
  • Click on a new code cell and type the same code:
print("Hello, World!")
  • Run the cell by clicking the play button on the left side of the cell or by pressing Shift + Enter. You should see Hello, World! printed out below the cell.

Congratulations! You've just written and run your first Python script. Running scripts are that easy! Now it's time for you to learn the core functionalities and aspects of Python.