2 Answers
+ 3
Use Tkinter module
from tkinter import *
# pip install pillow
from PIL import Image, ImageTk
class Window( Frame ) :
def __init __ ( self , master= None ) :
Frame . __init __(self , master)
self . master = master
self . pack ( fill = BOTH , expand= 1 )
load = Image . open ( " Koder. jpg" )
render = ImageTk . PhotoImage ( load )
img = Label ( self , image= render)
img. image = render
img. place ( x = 0 , y = 0 )
root = Tk()
app = Window( root )
root . wm_ title ( " Tkinter window" )
root . geometry( " 200x 120" )
root . mainloop()
0
#Pygame does it shorter:
import pygame_sdl2 as pygame
pygame.init()
image = pygame.image.load("smile.jpg")
surface = pygame.display.set_mode(image.get_size())
surface.blit(image, image.get_rect())
pygame.display.flip()
pygame.time.delay(5000)
pygame.quit()