On 2021-07-31 20:46, Dennis Lee Bieber wrote:
On Sat, 31 Jul 2021 14:07:05 +0530, 37_VA_VEER CHAKRABORTY
<veerchakraborty...@gmail.com> declaimed the following:
pygame.image.load('assets/Flappy Bird.png')
However, when I ran the script it was showing an error message - File not
found
Please advise me on how to upload the sprites and where I was going wrong.
First attempt: use a full pathname.
Second: determine what the "current working directory" is in which your
program is running, then use a pathname relative to that directory.
The path of the program itself should be in __file__. You can then use
os.path.dirname to get the path of its folder and os.path.join to build
a path from that to the image file.
--
https://mail.python.org/mailman/listinfo/python-list