0

enter image description here error code

My .png is in my folder and is in my workspace but i keep getting this error and putting r"cat.png" doesn't work same as changing \ to /.

Soorya
  • 1
  • 1

2 Answers2

0

It seems that the root directory is different from where you are running the python file. A quick solution is you can provide complete location of the cat.png file. For example

C://users//gksso//.......//cat.png

Sahidul Islam
  • 489
  • 5
  • 18
0

if you could paste your code here more help could be provided, but here is some code

backg = ('background.jpg')

As you can see i have created a variable that is assigned to the .png file you are trying to use. It should then work. Also make sure your .png file is properly put into your projects directories, like shown below. This is just an example.

Example of a .png file in a projects directory.(This ide is called replit!)

Antoni
  • 34
  • 3