In the final course, we’ll tie together the concepts that you’ve learned up until now. You’ll tackle real-world scenarios in Qwiklab’s that will challenge you to use multiple skills at once. this assignment consists of Qwiklab’s Assessment: “Scale and Convert Images using PIL“.
First, we’ll take a closer look at how to use external Python modules to extend your code’s capabilities, and spend some time learning how to use documentation to learn a new module. For example, we’ll use the Python Image Library (PIL) to create and modify images.
We’ll show you some simple examples of how to perform common tasks in the course material, but it will be up to you to explore the module documentation to figure out how to solve specific problems. Next, we’ll show you how to communicate with the world outside of your code! You’ll use data serialization to turn in-memory objects into messages that can be sent to other programs.
Your program will send messages across the network to Application Programming Interfaces (APIs) offered by other programs. For those times when your code needs to talk to a person instead of a program, you’ll also learn to send email messages. At the end of this course, you’ll be able to take a description of a problem and use your skills to create a solution — just like you would on the job. In your final capstone project, you’ll be given a description of what your customer needs, and it will be up to you to create a program to do it!
~~SKILLS YOU WILL GAIN~~
- Building a Solution
- Creating and Translating Media Files
- Interacting with Web Services
Course Link Click here
Qwiklab’s Assessment: “Scale and Convert Images using PIL”
#!/usr/bin/env python3 import os, sys from PIL import Image size = (128, 128) for infile in os.listdir(): outfile = os.path.splitext(infile) try: with Image.open(infile).convert('RGB') as im: im.thumbnail(size) im.rotate(270).save("/opt/icons/" + outfile, "JPEG") except OSError: pass