我不知道为什么这样不行。我正在mac上使用Python3。我试过了 标签.图像但它不起作用。这是我的密码:
File=open("/Users/user/Desktop/Python/File.txt")
FileContents=File.readlines()
ThingAmount=Team[0]
ActiveThing=Team[1]
ActiveThingImage=PhotoImage("/Users/user/Desktop/Python/"+ActiveThing+"/"+ActiveThing+".gif")
EnemyThingImage=PhotoImage("/Users/user/Desktop/Python/Enemy/EnemyThing.gif")
ActiveThingLabel=Label(window,image=ActiveThingImage)
ActiveThingLabel.image=ActiveThingImage
ActiveThingLabel.place(x=0,y=0)
EnemyThingLabel=Label(window,image=EnemyThingImage)
EnemyThingLabel.place(x=100,y=100)
图像可能会有点棘手-但我想我可以帮助两个答案!你知道吗
一:
让按钮有一个图像可能有点棘手(你需要一个2层的方法),但改变图像很容易。你知道吗
然后。。。你知道吗
那么。。。。。你知道吗
(添加self。或者根。等)
现在,要更改图像,只需执行以下操作:
二:
相关问题 更多 >
编程相关推荐