from tkinter import *
window = Tk()
e1_value = StringVar()
def printText():
print(e1_value.get())
# def printText():
# print('HelloWorld!')
b1 = Button(window, text = "Excute", command = printText())
b1.grid(row = 0, column = 0)
e1 = Entry(window, textvariable = e1_value)
e1.grid(row = 0, column = 1)
t1 = Text(window, height = 1, width = 20)
t1.grid(row = 0, column = 2)
window.mainloop()
I met an error that was printed out in the terminal so I couldn't print out the value into the terminal. The error said,
"TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhib"
, when I type something into Entry window. I've been searching for the answer on Google, but I still can't find it. Do you happen to know how to solve the problem?
Besides, I could see 'Hellow world!' only once even if I pushed the Button a few times.
I'm not acquainted with tkinter so I don't know what to do.
I deleted the parenthesis after printText.
b1 = Button(window, text = "Excute", command = printText)
I could print out what I typed in the Entry box. I still saw "TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhib" though.
from tkinter import *
window = Tk()
e1_value = StringVar()
def printText():
print(e1_value.get())
# def printText():
# print('HelloWorld!')
b1 = Button(window, text = "Excute", command = printText)
b1.grid(row = 0, column = 0)
e1 = Entry(window, textvariable = e1_value)
e1.grid(row = 0, column = 1)
t1 = Text(window, height = 1, width = 20)
t1.grid(row = 0, column = 2)
window.mainloop()