Python - Error con widget text tkinter

 
Vista:

Error con widget text tkinter

Publicado por nose (1 intervención) el 16/05/2020 05:05:29
tengo un error con el widget text al obtener los valores que este contine (get) y sinceramente no entiendo a que se debe ya que en otros codigos y en wikis que lei esta hecho exactamente igual que como lo hice yo; este es mi codigo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from tkinter import *
 
def Enviar():
    mmm=textoComentario.get("1.0",END)
    print(mmm)
 
def Enviar1():
    m=textovari.get()
    print(m)
 
 
base=Tk()
 
textoComentario=Text(base).pack()
boton=Button(base,text="mostrar texto de widget text",command=Enviar).pack()
textovari=StringVar()
texto1=Entry(base,textvariable=textovari).pack()
boton1=Button(base,text="mostar texto de entry",command=Enviar1).pack()
 
 
 
base.mainloop()

y el error es
mmm=textoComentario.get("1.0",END)
AttributeError: 'NoneType' object has no attribute 'get'
les agradeceria mucho su ayuda ya que no tengo ni idea a que se debe esto
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder