Python Image Loading Problem

William Norris

Reputable
May 3, 2014
3
0
4,510
hi guys I am using python to code a program not really very new to this language and need help here's the problem the code isn't loading the images i'm a bit confused if someone could help thanks a lot here's the code:

http://pastebin.com/bxepyEqW

any help much appreciated thanks P.S sorry for my spelling and grammar mistakes in a rush thanks :)
 
Solution
One thing I noticed is the syntax on line 18. The word alpha is spelled [strike]aplha[/strike]:

background1 = pygame.image.load("images/background1.png").convert_aplha()

Are you running Python as root? Do you have permission to access the images folder path? Do you have to be the owner of the folder or the images?

You could try making it a literal string with single quotes:

background1 = pygame.image.load('images/background1.png').convert_alpha()

w3techie

Reputable
May 24, 2014
20
0
4,540
One thing I noticed is the syntax on line 18. The word alpha is spelled [strike]aplha[/strike]:

background1 = pygame.image.load("images/background1.png").convert_aplha()

Are you running Python as root? Do you have permission to access the images folder path? Do you have to be the owner of the folder or the images?

You could try making it a literal string with single quotes:

background1 = pygame.image.load('images/background1.png').convert_alpha()
 
Solution