'Trying to open image with pysimplegui, but getting error window pop up
I am following this tutorial to try and get an image to show up in a window with pysimplegui. https://www.youtube.com/watch?v=KtlGrgWf6Y8
import PySimpleGUI as sg
import os
layout = [
[sg.Image(filename='test_image_2.png')],
[sg.Button('Exit')]
]
window = sg.Window("Image Viewer", layout)
while True:
event, values = window.read()
if event == "Exit" or event == sg.WIN_CLOSED:
break
window.close()
I use the same code that the teacher uses, and the same image file and saved in the same folder as the python file. When i run the code, I get the following window pop up: error pop up window
I cannot understand why this would be showing. Do i need to save the image file to a different location? Or is it something else?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|