guizero中的数组问题

时间:2018-09-19 10:35:05

标签: python

我正在用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()

0 个答案:

没有答案