I have a skeleton of a program that I want to use:
from tkinter import *
import urllib
import urllib.request
import xml.etree.ElementTree as ET
root = Tk()
def program():
print('Hello')
tex=Text(root)
tex.pack(side='right')
inputfield = Entry(root)
inputfield.pack(side='bottom')
text = inputfield.get()
but = Button(root,text="Enter", command = program)
but.pack(side='bottom')
root.mainloop()
Alright so recapping, the program is just a frame with a text field, input field and a button that says Enter
. I want to call the program the button calls without actually pressing the button. I want to input the text in the input field and press Enter on my keyboard to call the function.
Is that possible through tkinter?