Skip to content
Permalink
Browse files
New test file
  • Loading branch information
hortonr6 committed Nov 2, 2017
1 parent 610783a commit 185176fd9fd41945e8420d0f4f426a6116912a3d
Showing 1 changed file with 33 additions and 0 deletions.
@@ -0,0 +1,33 @@
import tkinter as tk
import Get_Functions as gf

window = tk.Tk()
window.title("Chatbot Jeff")
window.geometry("300x300")
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()
userName = gf.getName(userText)
userName = userName.title()
botText = "Hello " + userName + ", it's nice to meet you"
msgBox.configure(state="normal")
msgBox.insert(tk.END, userText)
msgBox.insert(tk.END, "\n")
msgBox.insert(tk.END, botText)
msgBox.configure(state="disabled")

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

tk.mainloop()

0 comments on commit 185176f

Please sign in to comment.