From the course: Python Essential Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Pillow - Python Tutorial
From the course: Python Essential Libraries
Solution: Pillow
(upbeat music) - [Instructor] All right, let's take a look at my solution to this particular challenge and see how it compares to yours. And remember, it's not important that your solution be the same as mine. There are almost always multiple ways to solve a programming problem. So let's go ahead and open up the challengesolution.py file. And you can see it's not very many lines of code. And that's because the Pillow library has a lot of great features in it. So here's what we're going to do. Now, the top of the file, obviously I need to import the Image class from the Pillow library. Pretty sure you got that. And I'm also going to make use of two of the standard library modules, the os module for working with file and path names and the glob module for building a list of files from a directory. All right, so my code to find a variable named thumbsize to be a tuple of 128 by 128. So this is the size that we're going to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.