1import pygame as pg
2
3pg.init()
4
5screen = pg.display.set_mode((display_width,display_height))
6
7# load the image in with file name
8yourImg = pg.image.load('yourImg.png')
9def showImg(x,y):
10 # pass the image and x,y values to screen
11 screen.blit(yourImg, (x,y))
12
13done = False
14while not done:
15 for event in pg.event.get():
16 if event.type == pg.QUIT:
17 pg.quit()
18 quit()
19 # call the function
20 showImg(10,10)
21 pg.display.update()
22pg.quit()
23quit()