0

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'

khelwood
  • 55,782
  • 14
  • 81
  • 108
Pthyon
  • 152
  • 10
  • I cannot seem to reproduce that error, what OS are you using? – Mercury Platinum Mar 29 '19 at 14:34
  • Im using windows based repl.it as i could get pygame to work on my Portable Python 3.5.1 client – Pthyon Mar 29 '19 at 14:53
  • I think that may be the problem, something like repl.it wont be able to emulate the drivers that pyweek needs to function, leading to a fatal error that gets directed away from you. Can you try do use a full python installation? – Mercury Platinum Mar 29 '19 at 15:40
  • I have python but Pygame doesnt work and when iv tryed to install it its failed – Pthyon Mar 29 '19 at 15:54
  • Its likely because youre using a portable python client, is it possible for you to have a full installation? [E.G Downloading the installer from python.org] – Mercury Platinum Mar 29 '19 at 16:12
  • I dont understand pure python there is no way of making long codes because when you press enter the whole thing runs – Pthyon Apr 01 '19 at 09:07

0 Answers0