我正在用python写一个简单的排序程序,遇到此错误。我想将值添加到数组(内部GUI)。
RL[0]=Text(app,size=10,font="Times New Roman",color="black",grid=[0,14])
TypeError:“元组”对象不支持项目分配
代码:
from guizero import App
from guizero import App,Text
from guizero import App,TextBox
from guizero import App,PushButton
from guizero import Slider
from guizero import Picture,Window
app=App(title="Sample",
height=480,
width=800,
layout='grid')
#Update multi ,single,Initial
app.bg = "white"
RL=("A","B","C","D","E","F")
RL[0]=Text(app,"",size=10,font="Times New Roman",color="black",grid=[0,14])
RL[1]=Text(app,"",size=10,font="Times New Roman",color="black",grid=[1,14])
RL[2]=Text(app,"",size=10,font="Times New Roman",color="black",grid=[2,14])
RL[3]=Text(app,"",size=10,font="Times New Roman",color="black",grid=[3,14])
RL[4]=Text(app,"",size=10,font="Times New Roman",color="black",grid=[4,14])
app.display()