0

So I'm creating a basic program that lets you play roulette for a Computer Science Class. The program is fully built, I just had a question regarding images in Python. Is is possible to have my program display an image when prompted to by an if statement? I'm fairly new to python, any help would be appreciated.

2 Answers 2

1
from PIL import Image

image = Image.open('path_to_image')
image.load()

Here is a tutorial on how to use Pil(low), a Python Image Library: How to use Pillow

Edit: You are probably building a GUI for you game, so check out TKinter, it's Graphical User Interface Library, with this you can create the "windows" of your game and place images and buttons there.

Sign up to request clarification or add additional context in comments.

Comments

0

Use Python Image Library(PIL), it's pretty easy and has tons of documentation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.