From the course: Complete Guide to Parallel and Concurrent Programming in Python
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Download images in Python - Python Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming in Python
Challenge: Download images in Python
(bright upbeat music) - [Instructor] For our third and final challenge problem, your goal will be to design and build a program to concurrently download a collection of image files from the internet and return the total number of bytes. We have 50 images hosted at the URL shown here, which you can use as the target files to download for this challenge. All of the JPEG files on that server are numbered sequentially from one to 50. To give you a starting point for this challenge, we've already implemented a sequential version of an image downloader in this example program. The sequential_download-images function on line 11 takes in a list of integers representing the image numbers to download. It simply uses a for loop to iterate through that list and passes each number to the download_image helper function, which downloads the corresponding file and then returns the number of bytes. The function accumulates those return values in the total bytes variable, and then returns the final…
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.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
Welcome to the challenges39s
-
(Locked)
Challenge: Matrix multiply in Python5m 29s
-
(Locked)
Solution: Matrix multiply in Python7m 58s
-
(Locked)
Challenge: Merge sort in Python4m 18s
-
(Locked)
Solution: Merge sort in Python5m 20s
-
(Locked)
Challenge: Download images in Python2m 7s
-
(Locked)
Solution: Download images in Python4m 9s
-
-