I want to add an image to my pygame program. The image is in the same directory as that of the py file. But still, when I run the program there is a problem. My code is:
background=pygame.image.load("background.png")
but still it does not work.
I searched it on the web and tried this:
background=pygame.image.load(os.path.abspath("/Users/Administrator/Vs code programming/Python/PYgame/background.png"))
this worked fine, but when I made my game I added the various images in the same folder with the exe file. But there was an error on the cmd saying "could not open the file". The location of the file was stated as the same as I entered in the abs path. People told me to investigate what my current paths and working directories were. But what does that mean? Please help me solve this. I am using VS Code.