M
M
marataziat2016-11-07 20:22:42
Python
marataziat, 2016-11-07 20:22:42

Why does entry in tkiner show numbers instead of strings?

I wrote:

def callback():
  print e1
  print e2
  print e3

master = Tk()
Label(master, text="vk login").grid(row=0)
Label(master, text="vk password").grid(row=1)
Label(master, text="vk message").grid(row=2)

e1 = Entry(master)
e2 = Entry(master)
e3 = Entry(master)

e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
e3.grid(row=2, column=1)
b = Button(master, text="OK", command=callback)
b.grid(row=3, column=1)


mainloop()

And I get:
.4381962680
.4381962536
.4381962608
.4381962680
And it should be:
Hello world

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
narwhale, 2016-11-07
@narwhale

Perhaps the variables are not initialized

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question