HG0724
HG未完待续
2021-01-22 21:54

pygame下相对路径加载图片出错问题

  • python

PS F:\python\python2021> python -u "f:\python\python2021\python_gui\pygame1.py"
pygame 2.0.1 (SDL 2.0.14, Python 3.7.0)
Hello from the pygame community. https://www.pygame.org/contribute.html   
Traceback (most recent call last):
  File "f:\python\python2021\python_gui\pygame1.py", line 14, in <module> 
    image = pygame.image.load(img)
FileNotFoundError: No such file or directory.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答