简单代码出错

时间:2016-10-20 13:44:36

标签: python-2.7

Python编程初学者。当我按下按钮时尝试更改标签文本时,我一直收到错误。

#Label Text Command
def Print_Stories():
    Printing_Label["text"] = "Printing"

#Printing Label
Printing_Label = Label(app, height=5, width = 19, font = "Calibri 20", bd = 2, relief = 'groove').place(x=20, y=170)

#Print Button
Button1 = Button(app, text ="Print", command= Print_Stories).place(x=100, y=110)

我得到的错误:

File "C:\Users\xxxxx\Desktop\xxxxx.py", line 136, in Print_Stories
Printing_Label["text"] = "Printing"
TypeError: 'NoneType' object does not support item assignment

感谢任何帮助

0 个答案:

没有答案