In this ICS4U lesson you will be learning how to:
The programming language of choice in this course is Python . I am aware that some of you will have programmed in different languages in Grade 11. There really isn’t much i can do to change that, but its the skills from grade 11 are what were important. So if you were a good coder in grade 11, it shouldn’t be too much of a chore to pick up a new language pretty quickly, and you will need to put in some extra effort right away to get caught up with the essentials of Python. If you have any interest in computer science as a future career, working with different languages is essential.
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. For some of the learning activities I’ll just have you type the code into a web editor and run the code from there, other times you’ll need to create and run the code from software on your computer.
The first thing you will need to do is setup an IDE (Integrated Development Environment) o your computer to run Python.
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.
IDLE Demo
Installing additional Packages
Later on in the course you will need to use some 3rd party packages for your projects.
To install these packages and be able to use them with IDLE, we can use a package management system called PIP. To access PIP you need to open a Terminal Window on your computer.
To actually install the packages, you need to just type the following in your terminal window
Pycharm is another very popular IDE that is used to create larger python projects. This is the IDE I use to create all my projects
Pycharm has a nice project management system allowing you to manage multiple files easier than IDLE.
Both IDLE and Pycharm can be installed from the Software Center on the HWDSB school board machines.
Another popular choice is VSCode. I don’t use it too much, but feel free to try it out and see if you can figure out how to configure it with the required packages install. I believe if you access the terminal from within VSCode that you can pip install whatever you want.
Install the base version of python and the required packages using PIP
import pygame
import cv2
import numpy as np
import mediapipe as mp
name = input("Enter your name: ")
print("Hi",name)
Go to the discussion forum on the HUB
Return to ICS4U Main Page