Uploading and Opening Images using Python - Don't use global variables - Don't use external libraries - Start the program with a main function (def main():)
Uploading and Opening Images using Python
- Don't use global variables
- Don't use external libraries
- Start the program with a main function (def main():)
Content:
- Make a menu using with 3 parts ("Open," "Collect," and "Quit"). After performing a part, repeat asking until they choose "Quit." Choosing "Quit" will end the program.
- If the user inputs "Open" or "Collect, they will be asked to upload an image file (.jpeg and jpg only). If the file isn't the right format, print out "Jpeg/Jpg only." Keep asking until the condition is met.
- If the user chose "Open," simply open the jpeg/jpg file.
- If the user chose "Collect," make a (only 1) separate function that requires the string 'image_name' as an argument and return's the image's pixel data. It returns a tuple containing the image dimensions in pixels (w, h) and the image data in a list of tuples with RGB (red, green, blue) values. Print out the data collected. (Remember to call this function to your main function.)
Thank you!
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)