Skip to content
Permalink
Browse files
Created new GUI file that uses determineUserInput
  • Loading branch information
hortonr6 committed Nov 3, 2017
1 parent 15fe2b2 commit e9350d2a22ca896aad484db59bf4aef588caac03
Showing 1 changed file with 33 additions and 0 deletions.
33 GUI2.py
@@ -0,0 +1,33 @@
import tkinter as tk
import determineUserInput as detUsrIn

window = tk.Tk()
window.title("Chatbot Jeff")
window.geometry("600x600")
window.configure(background="cornflower blue")

lblTitle = tk.Label(window, text="CHATBOT JEFF\n\n", bg="cornflower blue", font=(24))
lblTitle.pack()

userInput = tk.Entry(window)
userInput.pack()

lbl = tk.Label(window, text="\nChatHistory", bg="cornflower blue")
lbl.pack()

def cb(event):
userText = userInput.get()
botText = str(detUsrIn.determineUserInput(userText)[0])
userInput.delete(0, tk.END)
msgBox.configure(state="normal")
msgBox.insert(tk.END, "User: " + userText + "\n")
msgBox.insert(tk.END, "Jeff: " + botText + "\n")
msgBox.configure(state="disabled")
return 0

userInput.bind("<Return>", cb)
msgBox = tk.Text(window)
msgBox.pack()
msgBox.configure(state="disabled")

tk.mainloop()

0 comments on commit e9350d2

Please sign in to comment.