-1

How can i get a value from an entry if i use grid?

from tkinter import *
window = Tk()
window.title("Test")
window.geometry(600x600)
window.config()

e = Entry(window, width=20).grid(row=0, column=1)

entry = e.get()

print(entry)

1 Answers1

0

Move the .grid() down on a separate line

entry = Entry(window, width=20)
entry.grid(row=0, column=1)

print(entry)

BTW, you should have searched this site. I am sure there are millions like this

TheLizzard
  • 7,248
  • 2
  • 11
  • 31
PCM
  • 2,881
  • 2
  • 8
  • 30