• Matéria: Informática
  • Autor: planet4nerd
  • Perguntado 3 anos atrás

eu estou fazendo um programa em python e não para de dar esse erro, mas eu realmente não sei o que está dando errado:

AttributeError: 'Label' object has no attribute 'invocação'

o código(só a parte que importa):

def invocação():
math = Button(j, text = "matemática", fg = "white", bg = "gray")
quim = Button(j, text = "química", fg = "white", bg = "gray")
fisi = Button(j, text = "física", fg = "white", bg = "gray")
ingl = Button(j, text = "inglês", fg = "white", bg = "gray")
japo = Button(j, text = "japonês", fg = "white", bg = "gray")

math.place(x = 9 , y = 170)
quim.place(x = 9 , y = 200)
fisi.place(x = 9 , y = 230)
ingl.place(x = 9 , y = 260)
japo.place(x = 9 , y = 290)
def inicio():
global l,dia_l,dia_ba,dia_bb,dia_bc,mate,met_b,tem_b,tem_l,hor_ba,hor_bb,hor_l,dpr_b,dpr_l,marca
dia_l = Label(j, text = "data: ", font = "arial 12", fg = "white", bg = "gray")
dia_ba = Entry(j, width = 4)
dia_bb = Entry(j, width = 4)
dia_bc = Entry(j, width = 4)
mate = Label(j, text = "matéria: ", font = "arial 12", fg = "white", bg = "gray")
met_b = Button(j, text = "selecionar", font = "arial 12", fg = "white", bg = "gray", command = mate.invocação)
tem_l = Label(j, text = "tempo", font = "arial 12", fg = "white", bg = "gray")
tem_b = Button(j, text = "selecionar", font = "arial", fg = "white", bg = "gray")
hor_l = Label(j, text = "horário", font = "arial 12", fg = "white", bg = "gray")
hor_ba = Entry(j, width = 8)
hor_bb = Entry(j, width = 8)
dpr_l = Label(j, text = "depressão", font = "arial 12", fg = "white", bg = "gray")
dpr_b = Button(j, text = "selecionar", font = "arial 12", fg = "white", bg = "gray")
marca = Button(j, text = "marcar", font = "arial 12", fg = "white", bg = "gray", width = 20, height = 3)

dia_l.place(x = 40 , y = 10)
dia_ba.place(x = 8 , y = 36)
dia_bb.place(x = 40 , y = 36)
dia_bc.place(x = 72 , y = 36)
mate.place(x = 12 , y = 129)
met_b.place(x = 9 , y = 150)
tem_l.place(x = 12 , y = 189)
tem_b.place(x = 9 , y = 209)
hor_l.place(x = 10 , y = 65)
hor_ba.place(x = 8 , y = 87)
hor_bb.place(x = 68 , y = 87)
dpr_l.place(x = 196 , y = 191)
dpr_b.place(x = 189 , y = 209)
marca.place(x = 58 , y = 344)

obs: eu tenho depressão e estou fazendo esse programa para poder me ajudar nos estudos, por favor não fique zoando nos comentários


629551: vixi nao entendi nada

Respostas

respondido por: alguemeajudaplss
1

Resposta:

eu não sou um programador python, mas traduzindo o erro pra português significa "O objeto Label não tem um atributo invocação"

não sei exatamente onde é o erro pois não sei muito sobre python


alguemeajudaplss: pode ser mate = Label
alguemeajudaplss: e logo abaixo tem mate.invocação
planet4nerd: cara muito obrigao
planet4nerd: acabei de achar o erro, o erro era o ()
planet4nerd: eu coloquei só )
planet4nerd: muito obrigado mesmo cara :)
planet4nerd: met_b = Button(j, text = "何もない", font = "arial 12", fg = "white", bg = "gray", command = invocação)
planet4nerd: esse era o certo
Perguntas similares