[英]Tkinter PhotoImage() not finding directory
当图像路径正确时,Tkinter PhotoImage 会抛出 TclError 'no such file or directory'(据我所知)错误抛出和代码
文件树
我尝试使用双引号/单引号(尽管我不确定这是否重要),使用'/'和'\',将'background.png'放在与我的代码相同的目录中,但无济于事。
我有一种感觉,我在做一些愚蠢的事情,所以任何帮助将不胜感激,谢谢。
您正在寻找./images/background.png以使其成为相对路径。
./images/background.png
\images\background.png将指向文件系统或驱动器根目录。
\images\background.png
[英]Python Tkinter PhotoImage
[英]Transparency in Tkinter PhotoImage
[英]Add tag to Tkinter PhotoImage
[英]Tkinter PhotoImage in Jupyter
[英]tkinter photoimage constructor
[英]Tkinter's photoimage class
[英]Tkinter canvas PhotoImage is not appearing
[英]Tkinter PhotoImage: References in Memory?
[英]PhotoImage no such file or directory
[英]PhotoImage no such file or directory error
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.