4
Python images
trentgonzales (4)

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

You are viewing a single comment. View All
1
AllAwesome497 (80)

Images? Maybe turtle?

1
trentgonzales (4)

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

1
AllAwesome497 (80)

@trentgonzales like a mix of a few things.... hard to explain.
https://www.geeksforgeeks.org/working-images-python/amp/
try that, and keep programming! ;)

1
trentgonzales (4)

@AllAwesome497 did I do this right?

img = Image.open("book.jpg")

1
AllAwesome497 (80)

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

1
AllAwesome497 (80)

@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

1
trentgonzales (4)

@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"?

1
AllAwesome497 (80)

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