Skip to content
Permalink
Newer
Older
100644 33 lines (26 sloc) 840 Bytes
Nov 2, 2017
1
import tkinter as tk
2
import Get_Functions as gf
3
4
window = tk.Tk()
5
window.title("Chatbot Jeff")
6
window.geometry("300x300")
7
window.configure(background="cornflower blue")
8
9
lblTitle = tk.Label(window, text="CHATBOT JEFF\n\n", bg="cornflower blue", font=(24))
10
lblTitle.pack()
11
12
userInput = tk.Entry(window)
13
userInput.pack()
14
15
lbl = tk.Label(window, text="\nChatHistory", bg="cornflower blue")
16
lbl.pack()
17
18
def cb(event):
19
userText = userInput.get()
20
userName = gf.getName(userText)
21
userName = userName.title()
22
botText = "Hello " + userName + ", it's nice to meet you"
23
msgBox.configure(state="normal")
24
msgBox.insert(tk.END, userText)
25
msgBox.insert(tk.END, "\n")
26
msgBox.insert(tk.END, botText)
27
msgBox.configure(state="disabled")
28
29
userInput.bind("<Return>", cb)
30
msgBox = tk.Text(window)
31
msgBox.pack()
32
33
tk.mainloop()
You can’t perform that action at this time.