Instructions for typing and running your first program


Start here

 

We will now have you type, run, and save your first computer program.

Note:

 

Before we get to typing in a program, we first (if not already done) need to download and install Python and either Thonny or Spyder.

 

Step 1: install Anaconda: Pick between these two options and click through to follow instructions in installing Anaconda.

Then come back here and proceed with Step 2.

Incidentally, you might be asking: what exactly is Anaconda and what does it have to do with Python other than its name?

 

Step 2: install a code editor by selecting ONE of the following options:

 

Step 3: open a code editor Choose between:

 

Step 4: type and execute helloworld.py: Choose between:

 

Step 5: install matplotlib for Thonny users: What is matplotlib? It's a plotting package that we'll use. This comes packaged with Spyder and so, only Thonny users need to download this. Thonny is a nice editor and so Thonny users cheerfully do this additional step in order to use plotting along with Thonny.

 


Step 1: Installing Anaconda for Mac users

 

Video: Learn how to install Anaconda and open Spyder (which comes bundled with Anaconda). Note: the video will refer to Anaconda and Spyder somewhat interchangeably.

 

Now click on the Link to Anaconda and install it on your laptop.
 


Step 2: Mac Option A: Installing Thonny for Mac users

 

Video: Installing and opening Thonny (Mac)

 

Now click on the Link to Thonny and install it on your laptop.
 


Step 3: Mac Option A: Opening Thonny for Mac users

 

These screenshots explain how to open Thonny:

  • Step 3.A.1:

  • Step 3.A.2:

  • Step 3.A.3:

  • Step 3.A.4: You now have opened Thonny

  • Important:
    • When you open Thonny you aren't opening program files (yet). It's similar to opening Word without naming a text file to work on.
    • Your program files are going to be in specific folders. You need to look for them, and when you create new ones, save them in specific folders.
 


Step 4: Mac Option A: Helloworld in Thonny for Mac users

 

Video: Helloworld in Thonny (Mac)

 


Step 4: Mac Option B: Helloworld in Spyder for Mac users

 

Video: Helloworld in Spyder (Mac)

 


Step 5: Installing Matplotlib (or any package) for Mac Thonny Users

 

How to add a package (like Matplotlib):

  • To add a package (which will only be necessary for those using Thonny), first, open Thonny, and go to "Tools". From there, click on "Manage Packages".

  • Then, you will see a window like what is shown in the image above. Search for the "package" you need to install or remove. In this case, we have used the example of "Matplotlib", which you will need to have installed for some exercises. Once you've typed the name of the package, click "Find package from PyPI" or press the enter/return key.

  • To add the package, click the install button. You will then see a small popup while the package is installed.

 


Step 1: Installing Anaconda for Windows users

 

Video: Learn how to installing Anaconda on Windows. Note: the video will refer to Anaconda and Spyder somewhat interchangeably.

 

Now click on the Link to Anaconda and install it on your laptop.
 


Step 2: Windows Option A: Installing Thonny for Windows users

 

Video: Installing and opening Thonny (Windows)

 

Now click on the Link to Thonny and install it on your laptop.
 


Step 3: Windows Option A: Opening Thonny for Windows users

 

The following screenshots explain how to open Thonny:

  • Step 3.A.1:

  • Step 3.A.2:

  • Step 3.A.3:

  • Important:
    • When you open Thonny you aren't opening program files (yet). It's similar to opening Word without naming a text file to work on.
    • Your program files are going to be in specific folders. You need to look for them, and when you create new ones, save them in specific folders.
 


Step 4: Windows Option A: Helloworld in Thonny for Windows users

 

 

Video: Helloworld in Thonny (Windows)

 


Step 4: Windows Option B: Helloworld in Spyder for Windows users

 

Video: Helloworld in Spyder (Windows)

 


Step 5: Installing Matplotlib for Windows Thonny Users

 

How to add a package (like Matplotlib):

  • To add a package (which will only be necessary for those using Thonny), first, open Thonny, and go to "Tools". From there, click on "Manage Packages".

  • Then, you will see a window like what is shown in the image above. Search for the "package" you need to install or remove. In this case, we have used the example of "Matplotlib", which you will need to have installed for some exercises. Once you've typed the name of the package, click "Find package from PyPI" or press the enter/return key.

  • To add the package, click the install button. You will then see a small popup while the package is installed.



Back to Module 0


© 2017, Rahul Simha