Skip to content

Aug 20: Getting Started with Thonny

Learning Objectives

After today's class, you should be able to:

  • Open, edit, save, and run a program in Thonny.
  • Submit a homework exercise on Gradescope.
  • Ask and answer questions (later) on Piazza.

Lesson Outline

Welcome! [10 min]

Mini Lab [25 min]

  • Walk through Installing Thonny, etc. instructions
    • Skip steps 2 and 7 in the CS computer lab
    • Complete all steps on your own computer
  • Walk through how to submit on Gradescope
    • Click "Log In" then click "School Credentials"
    • Write a program that prints "Hello World"

Getting Help [15 min]

  • Click the Piazza link in Canvas and set up your account
  • What questions do you have about the syllabus/course?

Your To-Do List

By the end of today

  • Pre-Survey: Please submit this "quiz" if you haven't already!

Before Friday's class

Due Tuesday at 11pm

Example Code

Here is the solution for today's mini-lab. Notice how lines 1–6 are formatted. When you submit to Gradescope, always include (1) a short description, (2) your name, and (3) the date. These lines must be formatted exactly as shown.

hello_world.py
1
2
3
4
5
6
7
"""Lab0 Hello World.

Author: Chris Mayfield
Version: 08/20/2025
"""

print("Hello, World!")

Here is a more interesting example that uses turtle graphics. If you have time during/after class, try extending the following code to draw a picture. Check out Trinket's Visual Introduction to Python for ideas.

hello_turtle.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
"""Example turtle program.

Author: Chris Mayfield
Version: 08/20/2025
"""

import turtle
import time

turtle.shape("turtle")
turtle.speed(1)
time.sleep(0.5)

turtle.penup()
turtle.forward(25)
turtle.write("Hello there!")
turtle.backward(25)