TypeError: Can't convert 'method' object to str implicitly
Publicado por wilkin a duarte (4 intervenciones) el 29/08/2016 23:14:46
hola soy nuevo en la programacion com python y estoy aprendiendo un poco de tkinter , bueno estaba haciendo una practica sencilla donde introduciendo un dato detro de un campo de texto este te mostraba la informacion y te la mostraba en un label deltro de la ventana creada de tkinter la cosa es que cuando entro la informacion en el campo de teste y presiono el boton me sale un error que no entiendo
y este es el error que me sale:,
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1550, in __call__
return self.func(*args)
File "C:\Users\user\Desktop\ventana_practica.py", line 5, in mostrar
lb = Label(ven, text = "hola" + nombre.get()+ " " + apellido.get() +" tu direccion es " + direc.get). place(x= 10, y = 200)
TypeError: Can't convert 'method' object to str implicitly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from tkinter import*
def mostrar():
print ("Bienvenido")
lb = Label(ven, text = "hola" + nombre.get()+ " " + apellido.get() +" tu direccion es " + direc.get). place(x= 10, y = 200)
ven = Tk()
nombre = StringVar()
apellido = StringVar()
edad = IntVar()
direc = StringVar()
lb_nom = Label(ven, text = "Introdusca su Nombre: " ,font =("georgia")).place(x =10 , y= 10 )
c_nom = Entry (ven, textvariable = nombre ).place(x = 185, y =10)
lb_ape = Label(ven, text = "Introdusca su Apellido: " ,font =("georgia")).place(x =10 , y= 40 )
c_nom = Entry (ven, textvariable = apellido).place(x = 185, y =40)
lb_edad = Label(ven, text = "Introdusca su Edad: " ,font =("georgia")).place(x =10 , y= 70 )
c_edad = Entry (ven, textvariable = edad).place(x = 185, y =70)
lb_dir = Label(ven, text = "Introdusca su direccion: " ,font =("georgia")).place(x =10 , y= 100 )
c_dir = Entry (ven, textvariable = direc ).place(x = 185, y =100)
bot = Button(ven, text = "Mostras inf", command = mostrar).place(x=10, y= 130)
ven.title(" ventana con campo de texto ")
ven.geometry("500x300+100+100")
ven.mainloop()
y este es el error que me sale:,
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1550, in __call__
return self.func(*args)
File "C:\Users\user\Desktop\ventana_practica.py", line 5, in mostrar
lb = Label(ven, text = "hola" + nombre.get()+ " " + apellido.get() +" tu direccion es " + direc.get). place(x= 10, y = 200)
TypeError: Can't convert 'method' object to str implicitly
Valora esta pregunta


0