from PIL import Image as PILImage
Rewind_Normal = PhotoImage(file="Rewind_Normal.png")
RewindButton = Button(root, image = Rewind_Normal)
myimage = RewindButton.cget("image") // returns "pyimage0"
有没有办法从这个字符串中获取原始文件名? python或Tkinter似乎对图像使用了一个参考系统(基于cget返回的字符串)。我可以使用此引用检索图像的实际文件名吗
大概是这样的:
for item in pyimageList
if item.name == myimage
// do other things
目前没有回答
相关问题 更多 >
编程相关推荐