Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatbot-jeff/GUI.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (26 sloc)
1.27 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter #imports the tkinter GUI framework | |
import Get_Functions #imports the Get_Functions.py file so that the GUI can access the chatbot text recognition functions | |
window = tkinter.Tk() #creates an object called window, this is the main window which all the GUI elements are displayed in | |
#configures the window so it displays correctly | |
window.title("Chatbot Jeff") | |
window.geometry("600x800") | |
window.configure(background="cornflower blue") | |
#creates title text displayed in the window | |
lblTitle = tkinter.Label(window, text="CHATBOT JEFF\n\n", bg="cornflower blue", font=(24)) | |
lblTitle.grid(row = 0, column = 1) | |
#creates intro text | |
lblDesc = tkinter.Label(window, text="Welcome to Chatbot-Jeff\n\nThis chatbot was created by ALL group A1\n\n\n", bg="cornflower blue") | |
lblDesc.grid(row = 2, column = 1) | |
#creates the button (currently a non-functional button) | |
btnBegin = tkinter.Button(window, text="Click To Launch Chatbot") | |
btnBegin.grid(row = 3, column = 1) | |
def fetchFunc(): | |
usrInput = entry.get() | |
lblUsrIn = tkinter.Label(window, text=usrInput) | |
lblUsrIn.grid(row = 6, column = 2) | |
return 0 | |
entry = tkinter.Entry(window) | |
entry.grid(row = 5, column = 1) | |
btnSubmit = tkinter.Button(window, text="Submit", command=fetchFunc) | |
btnSubmit.grid(row = 6, column = 1) | |
window.mainloop() |