ICS3U Python Programming Environments

ICS3U Learning Goals

In this ICS3U lesson you will be learning how to:

  • Download and install Python to your computer
  • Use an Integrated Development Environment to write a python program

Python Programming Language

ICS3U ICS4U Python Image

You are going to be writing computer programs using the Python Programming Language 

  • Any Python v3.XX is appropriate.
  • Definitely do NOT use v2.XX as there are significant differences

Python is an Interpreted language and thus needs the python interpreter to run the code.  We can run that interpreter on our machines or through a server on the web.

It is VERY STRONGLY recommended that you have a PC/MAC to complete this course, however it is possible to complete the course using a website, its just not as user friendly. 

Learning Programming Concepts in ICS3U

I believe that passively acquiring information is NOT the best way to learn how to write computer programs.  During portions of each lesson you will be required to complete short Interactive Learning Activities.  In these activities you will be learning about small concepts and how certain pieces of code work.   You will do this without having to leave the browser window and go and use different software.  To accomplish this I have embedded an online website that can run python code directly in your current webpage

For example, if you click on the toggle button you will be able to open a Python Editor and type and run the code snippets that are given to you in the activities.

NOTE:   YOU WILL HAVE TO DELETE THE DEFAULT CODE THAT OPENS IN THE PYTHON EDITOR AUTOMATICALLY

Interactive Learning Activity

Open the Toggle name “Python Editor” and type the following code into the Python Editor and Run the code to see what happens

				
					name = input("Enter your name: ")
print("Hi",name)

				
			

Make sure to hit enter after typing your name in the output window. 

Delete the default code and enter the code you were instructed

These online websites are good to run small pieces of code for teaching and learning purposes, but most programmers don’t use a web based python kernel to write their programs.

Integrated Development Environments

The most common way to write programs in python is to use an Integrated Development Environment (IDE). An IDE contains

  • An editor, that lets you write the code
  • A python interpreter, that takes your code and translates into machine code. The running program is displayed in the “Python Console”
  • Debugger, allows you to test and trace through your code to find errors
IDE’s get installed onto your computer just the same as any other software package.  There MANY options that you could use for Python Programming.  It really makes absolutely NO difference to me what you choose to use.  Below are some options that I think are appropriate. 
 
I am recommending and supporting the IDE that comes with the python software installation.  If you know of others and wish to use them, be my guest, but you are on your own with getting them installed and using them.

 

IDLE

This is the most straightforward and lightweight way to create and run python programs on your computer.  It comes built in when you download python from python.org.  (If you are an HWDB student on a school board machine running windows 11, you can install python and IDLE from the “Software Center” in the Start Menu. )

Python Files

Whenever you save your python files in ICS3U from an IDE they will have the .py extension.  That is what you will hand in when I’m grading your work.  There is nothing special about these files, it is just your program code as you have written it in the editor.  

They will not however open in your IDE like regular Word or pdf files by “double clicking” them in your file manager.  If you do that, then your OS will likely try to actually just run the program using the python interpreter.  If you want to open and edit them, then that must be done within the IDE

Note to HWDSB Students…. Trying to send .py files in outlook email in our system likely won’t work as our security system treats them as a dangerous file.  

ICS3U Activity

Task #1 – Install the base version of python and the IDLE IDE

  • https://www.python.org/downloads/
  • Open IDLE and then
    • Create a program called “demoIDLE.py” and enter the code below.  
    • Get the program to run on your device
  • Make sure you are able to find that file in your file system so when you do assignments you can hand in your work.
				
					name = input("Enter your name: ")
print("Hi",name)

				
			

Task #2 – If you have successfully been able to install python on a computer and run the following code send a message to your teacher on the discussion forum.  If you don’t have a computer that you are able to install the software on, please send a message to your teacher on the discussion forum immediately and he will provide you with an alternative you can use.

Note:  This software can be installed (or might already be installed) on any HWDSB school board machine. or personal computer.  You might have issues if you are using an School Board Machine that is not from HWDSB.  Specifically Chromebooks from other school boards have caused issues in the past.  Its not a huge deal, there are alternate methods, but you need to let me know immediately so I can walk you through it.  CLOUD BASED ALTERNATIVES ARE AVAILABLE 

Return to ICS3U1 Main Page