Relative Content

Tag Archive for pythonimagepygameloadimage

Could not open resource file, pygame error: “FileNotFoundError: No such file or directory.”

Import pygame pygame.init() BG = pygame.image.load(‘_pycache_/test_bg.jpg’) def DrawGameWin(): window.blit(BG,(0,0)) pygame.display.update() DrawGameWin() python image pygame loadimage 6 The resource (image, font, sound, etc.) file path has to be relative to the current working directory. The working directory is possibly different from the directory of the python file. It is not enough to put the files in […]

Could not open resource file, pygame error: “FileNotFoundError: No such file or directory.”

Import pygame pygame.init() BG = pygame.image.load(‘_pycache_/test_bg.jpg’) def DrawGameWin(): window.blit(BG,(0,0)) pygame.display.update() DrawGameWin() python image pygame loadimage 6 The resource (image, font, sound, etc.) file path has to be relative to the current working directory. The working directory is possibly different from the directory of the python file. It is not enough to put the files in […]