When trying to set my background in pygame I seem to have run into an issue with the error line nohup: redirecting stderr to stdout
I've tried to look for what is actually wrong and see if the image is recognized but without any luck.
import pygame
import os
_image_library = {}
def get_image(path):
global _image_library
image = _image_library.get(path)
if image == None:
canonicalized_path = path.replace('/', os.sep).replace('\\', os.sep)
image = pygame.image.load(canonicalized_path)
_image_library[path] = image
return image
pygame.init()
screen = pygame.display.set_mode((400, 500))
done = False
clock = pygame.time.Clock()
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
screen.fill((255, 255, 255))
screen.blit(get_image('background.jpg'), (10, 5))
pygame.display.flip()
clock.tick(60)
I expect the code to display the background image: 'background.jpg'