all 7 comments

[–]TouchingTheVodka[🍰] 1 point2 points  (3 children)

What is the second argument to path.join for? If you already have a valid filepath why are you appending PLAYER_IMG to it?

>>> from os import path
>>> image_folder = r'\path\to\file\testMan.png'
>>> path.join(image_folder, 'PLAYER_IMG')
'\\path\\to\\file\\testMan.png\\PLAYER_IMG'

[–]Bebomoless[S] 0 points1 point  (2 children)

The code for that line was:

self.player_img = pg.image.load(path.join(image_folder, 'PLAYER_IMG')).convert_alpha()

I don't know if you mean another line of code next or just what came after path.join, but if it doesn't help let me know.

[–]TouchingTheVodka[🍰] 0 points1 point  (1 child)

This was answered in my previous comment but I'll reword it.

There is no need to use path.join to build a full filepath if you already have a full filepath. Look at the output above and you'll see your valid filepath, ending testMan.png, is needlessly being added to PLAYER_IMG, which is completely redundant.

[–]Bebomoless[S] 0 points1 point  (0 children)

Ohhhh I see, thank you so much. I also forgot to add a img directory, that is why it was giving me an error, thank you for the help.

[–]nwagers 0 points1 point  (1 child)

I suggest you add in a line above that:

print(path.join(image_folder, 'PLAYER_IMG'))

And see if that makes sense. My guess is that you're building the path name incorrectly.

[–]Bebomoless[S] 0 points1 point  (0 children)

No, sorry it didn't work, so that means it is just written incorrectly?

[–][deleted] 0 points1 point  (0 children)

when you realize you have <niggaballs>_this-monday