How to insert image in python pygame i cant drag a file
i use ubuntu to code pls help me how How to insert image in python pygame i cant drag a file i am a student pls hellp
Voters
supcoolak
Well, I don't know what you want the image for, but
@TommyVictory below did say how to upload. To use the image in pygame, usepygame.image.load('path/to/image')
.mesquite2234
Press the three dots
Then press upload file
First, just upload the file/image to your folder in your repl. Next, to insert an image in pygame, here is sample code:
import pygame
pygame.init()
white = (255, 255, 255)
X = 400
Y = 400
display_surface = pygame.display.set_mode((X, Y ))
set the pygame window name
pygame.display.set_caption('Image')
#load image
image = pygame.image.load(r'C:\Users\user\Pictures\test.jpg')
while True :