How do I display an image that is saved in my gallery ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do I display an image that is saved in my gallery ?

27th Sep 2017, 1:52 PM
Lalith Kumar
Lalith Kumar - avatar
3 Answers
+ 7
If you are referring to SoloLearn, that can't be done in Python for now. Try Web or PHP, instead. Anyway, you will have to upload your image to some publicly accessible repository, like imageshack.us or imgur.com - they both have decent short url generators. After uploading, you should use the provided URL.
27th Sep 2017, 3:41 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
As Kuba said, it doesn't work with SL, but the Pillow module is a cool image handler (pip install Pillow). This works on a PC (I'm still wrestling with it on Android). if you write this code and save it as, e.g. PIL_test.py from PIL import Image img = Image.open('test.jpg') img.show() and save your picture ('test.jpg') in the same folder as PIL_test.py and run the code, the image will open in your default image viewer. You can also include the path to your image. more info at http://pillow.readthedocs.io/en/4.0.x/handbook/tutorial.html
27th Sep 2017, 8:25 PM
David Ashton
David Ashton - avatar
+ 1
But gallery app in our phones does not depend on any web or php. Do they?
28th Sep 2017, 1:35 AM
Lalith Kumar
Lalith Kumar - avatar