Ask coding questions

← Back to all posts
Python images
trentgonzales (11)

How do I get an image to show in my python program?

HarperframeInc (277)

Hi Trentgonzales.
Because Python is a console, It would not be able to show images.
The only way to show images is via. tkinter, which is unavailable to as of right now.

Please upvote this post if it helped you.

trentgonzales (11)

@HarperframeInc ok then, is there a program that does support pictures?

a5rocks (787)

@trentgonzales Well you can use sixels and rob mode

HarperframeInc (277)

@trentgonzales No, but using an online website, it is possible to turn an image into ascii text.

AaronWrost (0)

thanks homie this helped a lot [email protected]

RyanRana (193)

Well depending on how new you are there are a few ways you can do it. Python console(IDLE) does not support pictures, although if you want you can use Turtle API, and this link provides you with some nice tutorials on the Turtle (
That is pretty basic, but for some more advanced stuff you can learn GUI(Graphical User Interface), from this link for a series on the topic(

Like this post if it helped!

AllAwesome497 (364)

Images? Maybe turtle?

trentgonzales (11)

@AllAwesome497 What is turtle? Sorry, I am kinda new to this.

AllAwesome497 (364)

@trentgonzales like a mix of a few things.... hard to explain.
try that, and keep programming! ;)

trentgonzales (11)

@AllAwesome497 did I do this right?

img ="book.jpg")

AllAwesome497 (364)

@trentgonzales idk- never touched images, never felt the need. Is there a problem with it?

AllAwesome497 (364)

@trentgonzales If that doesn't work, make a new file in the repl called requirements.txt (EXACTLY that) (if u haven't already) then in its own line put in the word Pillow that is the equivalent to pip install. then at the beggining of the python file put in from PIL import Image

trentgonzales (11)

@AllAwesome497 it's not showing, I'm trying to get images to show. It doesn't say anything about showing them, but it does say something about a "Relative path"?

AllAwesome497 (364)

@trentgonzales Is the file uploaded in the repl, and in the same folder (if any) as the py folder?