Using the Canvas in Tkinter

Learn how to use the Canvas for shapes, colors, and objects with Tkinter and Python.

TECHNOLOGIES

Tkinter

WATCH TIME

39 minutes

Lessons

An Introduction to Canvas

In this video, you'll learn about the concept of Canvas and the graphics state to create objects, add colors, shapes, and rich graphics in our window. 7 min

Creating a Random Rectangle Generator

We'll create a random rectangle generator where a user can specify how many rectangles they want to generate with a different width and height. Be sure to try randomizing rectangle colors for extra fun! 7 min

Adding Canvas Objects

In this video, we'll experiment with using the canvas to create a line and a polygon. 6 min

Utilizing the Canvas Fill

We'll learn how to utilize functions to pass in parameters, specify X and Y coordinates to create rectangles and other shapes as well as filling to experiment with colors. 5 min

Adding Animations

In this video, we'll learn about animations, a core concept of gaming and stellar GUIs, by using the time module. 7 min

Adding Text and Arcs

We'll learn how to add an arc or a curved line on the screen and change fonts, colors, and size. 9 min

Hey! I’m Avi, and I’ll teach you how to build!

I'm Avi, your new Python instructor and founder of The Codex.

Three years ago I was stuck. I wasn’t learning anything in my theory-filled CS classes, my friends took pictures of me sleeping in lecture, and I was questioning why I was even learning CS to begin with. I had ideas but I was clueless on execution.

After watching hours of webcasted YouTube videos, enrolling in course after course, and struggling to stay motivated, I finally obtained the skills to bring my ideas to life. I realized how lonely and gruesome this process was.

If you’re a student just like me, you know exactly what it’s like to be stuck in course hell. The best programmers of today learned by doing, not by reading syntax in a textbook.

Join The Codex. Become a creator.

Savvy Students ❤️ The Codex

The Codex has helped hundreds of students find jobs and build their dream projects.

“CS classes at UW were overwhelming and full of theory. Through The Codex, I realized the power of Python programming, built numerous projects for my resume and ultimately landed an internship at Amazon.“
Arjun Malhotra
University of Washington, 2022
SDE Internship, Amazon

Ready to dive in? Start learning today.