I am trying to take a user input from an entry input and display it back to the user in a simpl text widget. I have implementing a label but apparently that's a bad idea for what I desire.
Ultimatley, I'd like my gui to look like this:
Bot: Oh hey there,
User: How are you
My gui and response code is as follows:
#Creating the GUI myText = tk.StringVar() window.resizable(False, False) window.title("Ashley-UDOL Chatbot") window.geometry('400x400') User_Input = tk.Entry(window, textvariable=myText, width=50).place(x=20, y=350) subButton = tk.Button(window, text="Send", command=Response).place(x =350, y=350) displayText = Text(window, height=20, width=40).pack() scroll = Scrollbar(window, command=displayText).pack(side=RIGHT) window.mainloop()
And my command:
def Response(): global result result = myText.get() displayText(window, result) return #print ('User:', result)
So just to confirm, the user types in the entry box and clicks send, triggering the Response, I'd like to show that input in the Text widget. (The print user is just a test, it works but shows in the command line obviously) ...Thank you guys.