+ 1
help me with this code pls
i creating a pygame code but it dont function this is the code import pygame import random pygame.init() background = pygame.image.load('images\sfondo.png') bird = pygame.image.load('images\uccello.png') base = pygame.image.load('images\base.png') gameover = pygame.image.load('images\gameover.png') tube1 = pygame.image.load('images\tubo.png') tube2 = pygame.transform.flip(tubo_giu, False, True) display = pygame.display.set_mode((288,512)) this i the error message (unicode error)'unicodeescape' codec cant decode bytes in position 6-10:truncated\uXXXX escape
11 Antworten
+ 3
I don't know about pygame.
However when copying file paths on windows os, we usually need to change backslashes to forward slashes, because (single) backslashes are reserved for escape sequences. I think that is what the error you got from your initial code wants to tell us.
+ 4
Simone then you don't have to write 'images/background.png' but this: 'background.png'
+ 2
Sololearn is not able to run this code because you need the pygame module. You can install it on your pc, but you have to install Visual Studio/ IDE / ... first. You can also use your phone by installing Pydroid.
+ 2
Simone then you have to install the pygame module. If you don't know how, check some tutorials on youtube or google
+ 2
Simone I think I can't help anymore but I will try
+ 1
If someone answer to me i will be happy
0
I installed the pygame libraries
0
No but i search on google and if i write in code background=pygame.image.load('images/background.png') it function but it dont function with me
0
Thanks for your help. I think i put the .py file in the images' folder
0
Oh thanks lisa for answered. Thanks for the answerd. Now i modify the code and i write you if it function
- 1
This code dont function in my pc