<repo_name>TheFredward/Python_project<file_sep>/MainPage.py
import tkinter as tk
import random
import time
from Dictionary import Dictionary



class Page(tk.Frame):
    def __init__(self, *args, **kwargs):
        tk.Frame.__init__(self, *args, **kwargs)
    def show(self):
        self.lift()

class Page1(Page):
   def __init__(self, *args, **kwargs):
       Page.__init__(self, *args, **kwargs)
       firstLabel = tk.Label(self, font=('arial', 50, 'bold'), text="Welcome to my Window", fg = "Black", bd = 10, anchor = 'w')
       firstLabel.grid(row = 0, column = 0)
       list = [ ]
       self.localtime = time.asctime(time.localtime(time.time()))
       TimeLabel = tk.Label(self, font=('arial', 20, 'bold'), text=self.localtime, fg = "Black", bd = 10, anchor = 'w')
       TimeLabel.grid(row = 0, column = 6)

       self.text_Input = tk.StringVar()
       self.operator = " "
       txtDisplay = tk.Entry(self, font=('arial', 15), textvariable = self.text_Input, bd = 5, insertwidth=4, bg = "white", justify = 'right')
       txtDisplay.grid(columnspan=4, row = 3, column = 1)
       IDLabel = tk.Label(self, font=('arial', 20, 'bold'), text="Enter ID Number", fg = "Black", bd = 10, anchor = 'w')
       IDLabel.grid(columnspan=4, row = 1, column = 1)

       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "1", bg = "gray", command = lambda: buttonClick("1")).grid(row=4, column=1, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "2", bg = "gray", command = lambda: buttonClick("2")).grid(row=4, column=2, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "3", bg = "gray", command = lambda: buttonClick("3")).grid(row=4, column=3, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "4", bg = "gray", command = lambda: buttonClick("4")).grid(row=5, column=1, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "5", bg = "gray", command = lambda: buttonClick("5")).grid(row=5, column=2, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "6", bg = "gray", command = lambda: buttonClick("6")).grid(row=5, column=3, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "7", bg = "gray", command = lambda: buttonClick("7")).grid(row=6, column=1, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "8", bg = "gray", command = lambda: buttonClick("8")).grid(row=6, column=2, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "9", bg = "gray", command = lambda: buttonClick("9")).grid(row=6, column=3, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "OK", bg = "gray", command = lambda: AddClick()).grid(row=7, column=1, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "0", bg = "gray", command = lambda: buttonClick("0")).grid(row=7, column=2, sticky="ew")
       okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "<-", bg = "gray", command = lambda: DeleteClick()).grid(row=7, column=3, sticky="ew")

       def buttonClick(numbers):
           global operator
           self.operator = self.operator + str(numbers)
           self.text_Input.set(self.operator)
           return;
           # shold pass choice password, and the password itself so that we can recall it later
       def OKClick(passChoice):
           global operator
       # get value and store in passChoice
           print(self.passChoice)
           # have an empty dictionary to save the password but not sure if it will create a new one each time....
           passwordKeys = {}
           # check that operator is not null
           if len(self.operator) > 0:
               passwordKeys = dict([(self.passChoice,self.operator)])
               print(passwordKeys)
           else:
               print('No value has been input')
               return;
       def DeleteClick():
           global operator
           self.operator = self.operator[:-1]
           self.text_Input.set(self.operator)
           return;

       def AddClick():
           global operator
           DC = Dictionary()
           DC.AddToArray(self.operator, list)
           DC.PrintList(list)
           self.operator = " "
           self.text_Input.set(self.operator)
           return;

class Page2(Page):
   def __init__(self, *args, **kwargs):
       Page.__init__(self, *args, **kwargs)
       label = tk.Label(self, text="This is page 2")
       label.pack(side="top", fill="both", expand=True)

class Page3(Page):
   def __init__(self, *args, **kwargs):
       Page.__init__(self, *args, **kwargs)
       label = tk.Label(self, text="This is page 3")
       label.pack(side="top", fill="both", expand=True)

class MainView(tk.Frame):
    def __init__(self, *args, **kwargs):
        tk.Frame.__init__(self, *args, **kwargs)
        p1 = Page1(self)
        p2 = Page2(self)
        p3 = Page3(self)

        buttonframe = tk.Frame(self)
        container = tk.Frame(self)
        buttonframe.pack(side="top", fill="x", expand=False)
        container.pack(side="top", fill="both", expand=True)

        p1.place(in_=container, x=0, y=0, relwidth=1, relheight=1)
        p2.place(in_=container, x=0, y=0, relwidth=1, relheight=1)
        p3.place(in_=container, x=0, y=0, relwidth=1, relheight=1)

        b1 = tk.Button(buttonframe, text="Page 1", command=p1.lift)
        b2 = tk.Button(buttonframe, text="Page 2", command=p2.lift)
        b3 = tk.Button(buttonframe, text="Page 3", command=p3.lift)

        b1.pack(side="left")
        b2.pack(side="left")
        b3.pack(side="left")


root = tk.Tk()
if __name__ == "__main__":

    main = MainView(root)
    main.pack(side="top", fill="both", expand=True)
    root.wm_geometry("400x400")
    root.mainloop()
<file_sep>/MainView.py
import tkinter as tk
import random
import time

LARGE_FONT = ("Verdana", 12)
class MainView(tk.Tk):

    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)
        container = tk.Frame(self)

        container.pack(side="top", fill="both", expand = True)

        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        #SP = StartPage(self)

        self.frames = { }

        frame = StartPage(container, self)
        #frame = MainPage(container, self)
        self.frames[StartPage] = frame
        #self.frames[MainPage] = frame
        #self.frames[MainPage] = MainPage(container, self)

        frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame(StartPage)

    def show_frame(self, cont):

        frame = self.frames[cont]
        frame.tkraise()


class StartPage(tk.Frame):

    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        buttonframe = tk.Frame(self)
        buttonframe.pack(side="top", fill="x", expand=False)
        label = tk.Label(self, text = "Start Page", font=LARGE_FONT)
        label.pack(pady=10, padx=10)
        MP = MainPage(controller, self)
        b1 = tk.Button(buttonframe, text="Page 1", command=MP.lift)
        MP.place(in_=buttonframe, x=0, y=0, relwidth=1, relheight=1)
        b1.pack(side="left")

class MainPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        # FrameOne = tk.Frame(self,height = 0, width = 1600, bg="blue")
        # FrameOne.pack(side="top")
        #
        # FrameTwo = tk.Frame(self, height = 700, width = 800, bg="blue")
        # FrameTwo.pack(side="left")
        #
        # FrameThree = tk.Frame(self, height = 700, cursor = "dot", width = 400, bg="light gray")
        # FrameThree.pack(side="right")
        # FrameFour = tk.Frame(self, height = 700, cursor = "dot", width = 400, bg="light gray")
        # FrameFour.pack(side="top")

        firstLabel = tk.Label(self, font=('arial', 50, 'bold'), text="Welcome to my Window", fg = "Black", bd = 10, anchor = 'w')
        firstLabel.grid(row = 0, column = 0)

        self.localtime = time.asctime(time.localtime(time.time()))
        TimeLabel = tk.Label(self, font=('arial', 20, 'bold'), text=self.localtime, fg = "Black", bd = 10, anchor = 'w')
        TimeLabel.grid(row = 1, column = 0)

        self.text_Input = tk.StringVar()
        operator = " "
        txtDisplay = tk.Entry(self, font=('arial', 15), textvariable = self.text_Input, bd = 5, insertwidth=4, bg = "white", justify = 'right')
        txtDisplay.grid(columnspan=4, row = 0, column = 0)
        IDLabel = tk.Label(self, font=('arial', 20, 'bold'), text="Enter ID Number", fg = "Black", bd = 10, anchor = 'w')
        IDLabel.grid(row = 0, column = 6)


app = MainView()
app.mainloop()
<file_sep>/tkinter_Window.py
from tkinter import*
import random
import time
from Dictionary import Dictionary

'''This is going to focus on the multi_window concept and focus on getting windows from different files within the same folder and properly displaying them'''
window = Tk()                               #Parent Window
window.geometry("1600x800+0+0")
window.title("Testing Window")
list = []
DC = Dictionary();
# class FrameSetup():
#     mRelief = SUNKEN
#     def __init__(self,mWindow,mHeight, mWidth,mBg):
#         self.mWindow = mWindow
#         self.mWidth = mWidth
#         self.mHeight = mHeight
#         self.mBg = mBg
#     def setFrame(self):
#         Frame(mWindow, height = self.mHeight,width = self.mWidth, bg=self.mBg, relief=mRelief)

FrameOne = Frame(window,height = 0, width = 1600, bg="blue", relief=SUNKEN)
FrameOne.pack(side=TOP)

FrameTwo = Frame(window, height = 700, width = 800, bg="blue", relief=SUNKEN)
FrameTwo.pack(side=LEFT)

FrameThree = Frame(window, height = 700, cursor = "dot", width = 400, bg="light gray", relief=SUNKEN)
FrameThree.pack(side=RIGHT)
FrameFour = Frame(window, height = 700, cursor = "dot", width = 400, bg="light gray", relief=SUNKEN)
FrameFour.pack(side=TOP)

firstLabel = Label(FrameOne, font=('arial', 50, 'bold'), text="Welcome to my Window", fg = "Black", bd = 10, anchor = 'w')
firstLabel.grid(row = 0, column = 0)

localtime = time.asctime(time.localtime(time.time()))
TimeLabel = Label(FrameTwo, font=('arial', 20, 'bold'), text=localtime, fg = "Black", bd = 10, anchor = 'w')
TimeLabel.grid(row = 1, column = 0)

text_Input = StringVar()
operator = " "
txtDisplay = Entry(FrameThree, font=('arial', 15), textvariable = text_Input, bd = 5, insertwidth=4, bg = "white", justify = 'right')
txtDisplay.grid(columnspan=4, row = 0, column = 0)
IDLabel = Label(FrameFour, font=('arial', 20, 'bold'), text="Enter ID Number", fg = "Black", bd = 10, anchor = 'w')
IDLabel.grid(row = 0, column = 6)
#DC = Dictionary(operator)
def buttonClick(numbers):
    global operator
    operator = operator + str(numbers)
    text_Input.set(operator)

    return;
# shold pass choice password, and the password itself so that we can recall it later
def OKClick(passChoice):
    global operator
    # get value and store in passChoice
    print(passChoice)
    # have an empty dictionary to save the password but not sure if it will create a new one each time....
    passwordKeys = {}
    # check that operator is not null

    if len(operator) > 0:
        passwordKeys = dict([(passChoice,operator)])
        print(passwordKeys)
    else:
        print('No value has been input')
        return;
def DeleteClick():
    global operator
    operator = operator[:-1]
    text_Input.set(operator)
    return;

def AddClick():
    global operator
    DC.AddToArray(operator, list)
    DC.PrintList(list)
    operator = " "
    text_Input.set(operator)
    return;

class CreateButton():
    """Doc: Class that will be used to create numerical keys and later alphabet keys to display and save the values in dictionaries so that they can be refered back via keys (for the time being)"""
    # local variables in create button class
    vark = StringVar(window)
    padx = 20
    pady = 16
    bd = 4
    fg = "black"
    mFont = ('arial',15)
    mBg = 'gray'
    def __init__(self,frameNmbr,mText,mRow,mColumn):
        self.frameNmbr = frameNmbr
        self.mText = mText
        self.mRow = mRow
        self.mColumn = mColumn
    def passButtonVal(self):
        okayButton = Button(self.frameNmbr, padx = self.padx, pady = self.pady, bd = self.bd, fg = self.fg, font = self.mFont, text = self.mText, bg = self.mBg, command = lambda: buttonClick(self.mText)).grid(row=self.mRow, column = self.mColumn, sticky="ew")
        # the enterButton specially made due to the command being different as well as the deleteButton. The OkClick should pass the passwordSelected choice but doesn't at the moment...only passses the firstLabel
    def enterButton(self):
        okayButton = Button(self.frameNmbr, padx = self.padx, pady = self.pady, bd = self.bd, fg = self.fg, font = self.mFont, text = self.mText, bg = self.mBg, command = lambda:  OKClick(mPassChoice)).grid(row=self.mRow, column= self.mColumn, sticky="ew")
    def deleteButton(self):
        okayButton = Button(self.frameNmbr, padx = self.padx, pady = self.pady, bd = self.bd, fg = self.fg, font = self.mFont, text = self.mText, bg = self.mBg, command = lambda: DeleteClick()).grid(row= self.mRow, column= self.mColumn, sticky="ew")
    def AddButton(self):
        okayButton = Button(self.frameNmbr, padx = self.padx, pady = self.pady, bd = self.bd, fg = self.fg, font = self.mFont, text = self.mText, bg = self.mBg, command = lambda: AddClick()).grid(row= self.mRow, column= self.mColumn, columnspan=3, sticky="ew")
    # dropDownMenu used to select password save position for retrival later on
    def dropDownMenu(self):
        vark = StringVar(window)
        PASSCHOICE = ['Select Password','<PASSWORD>','<PASSWORD>','<PASSWORD>']
        vark.set(PASSCHOICE[0])
        w = OptionMenu(window,vark,*PASSCHOICE)
        w.pack()
        # made mPasschoice global due to scope issues, need to correct this later on or problems will occur, such as other methods/functions being able to access this variables
        global mPassChoice
        mPassChoice = vark.get()



# initialize all buttons using CreateButton class and pass the necessary values that are needed
okayButton1 = CreateButton(FrameThree,"1",1,0)
okayButton2 = CreateButton(FrameThree,"2",1,1)
okayButton3 = CreateButton(FrameThree,"3",1,2)
okayButton4 = CreateButton(FrameThree,"4",2,0)
okayButton5 = CreateButton(FrameThree,"5",2,1)
okayButton6 = CreateButton(FrameThree,"6",2,2)
okayButton7 = CreateButton(FrameThree,"7",3,0)
okayButton8 = CreateButton(FrameThree,"8",3,1)
okayButton9 = CreateButton(FrameThree,"9",3,2)
okayButton = CreateButton(FrameThree,"OK",4,0)
okayButton0 = CreateButton(FrameThree,"0",4,1)
okayButtonAdd = CreateButton(FrameThree, "Add", 5, 0)
okayButton_bckspc = CreateButton(FrameThree,"<-",4,2)
# create a password select dropdown menu as a CreateButton
passwordSelect = CreateButton(FrameThree,'Select Password',5,1)
passwordSelect.dropDownMenu()
okayButton1.passButtonVal()
okayButton2.passButtonVal()
okayButton3.passButtonVal()
okayButton4.passButtonVal()
okayButton5.passButtonVal()
okayButton6.passButtonVal()
okayButton7.passButtonVal()
okayButton8.passButtonVal()
okayButton9.passButtonVal()
okayButton.enterButton()
okayButton0.passButtonVal()
okayButtonAdd.AddButton()
okayButton_bckspc.deleteButton()
window.mainloop()
<file_sep>/MyApp/MyApplication.py
import tkinter as tk
from tkinter import font  as tkfont
import random
import time
from Dictionary import Dictionary
import sqlite3
from LoginDataBase import loginDB

class MyApplication(tk.Tk):

    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        self.title_font = tkfont.Font(family='Helvetica', size=18, weight="bold", slant="italic")

        # the container is where we'll stack a bunch of frames
        # on top of each other, then the one we want visible
        # will be raised above the others
        container = tk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}
        for F in (MainView, LoginView, CreateAccountView):
            page_name = F.__name__
            frame = F(parent=container, controller=self)
            self.frames[page_name] = frame

            # put all of the pages in the same location;
            # the one on the top of the stacking order
            # will be the one that is visible.
            frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame("LoginView")

    def show_frame(self, page_name):
        '''Show a frame for the given page name'''
        frame = self.frames[page_name]
        frame.tkraise()

class MainView(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        # loginPage = LoginPage(self)
        self.controller = controller
        firstLabel = tk.Label(self, font=('arial', 50, 'bold'), text="Welcome to my Window", fg = "Black", bd = 10, anchor = 'w')
        firstLabel.grid(row = 0, column = 0)
        list = [ ]
        self.localtime = time.asctime(time.localtime(time.time()))
        TimeLabel = tk.Label(self, font=('arial', 20, 'bold'), text=self.localtime, fg = "Black", bd = 10, anchor = 'w')
        TimeLabel.grid(row = 0, column = 6)

        self.text_Input = tk.StringVar()
        self.operator = " "
        txtDisplay = tk.Entry(self, font=('arial', 15), textvariable = self.text_Input, bd = 5, insertwidth=4, bg = "white", justify = 'right')
        txtDisplay.grid(columnspan=4, row = 3, column = 1)
        IDLabel = tk.Label(self, font=('arial', 20, 'bold'), text="Enter ID Number", fg = "Black", bd = 10, anchor = 'w')
        IDLabel.grid(columnspan=4, row = 1, column = 1)

        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "1", bg = "gray", command = lambda: buttonClick("1")).grid(row=4, column=1, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "2", bg = "gray", command = lambda: buttonClick("2")).grid(row=4, column=2, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "3", bg = "gray", command = lambda: buttonClick("3")).grid(row=4, column=3, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "4", bg = "gray", command = lambda: buttonClick("4")).grid(row=5, column=1, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "5", bg = "gray", command = lambda: buttonClick("5")).grid(row=5, column=2, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "6", bg = "gray", command = lambda: buttonClick("6")).grid(row=5, column=3, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "7", bg = "gray", command = lambda: buttonClick("7")).grid(row=6, column=1, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "8", bg = "gray", command = lambda: buttonClick("8")).grid(row=6, column=2, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "9", bg = "gray", command = lambda: buttonClick("9")).grid(row=6, column=3, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "OK", bg = "gray", command = lambda: AddClick()).grid(row=7, column=1, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "0", bg = "gray", command = lambda: buttonClick("0")).grid(row=7, column=2, sticky="ew")
        okayButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "<-", bg = "gray", command = lambda: DeleteClick()).grid(row=7, column=3, sticky="ew")
        LogOutButton = tk.Button(self, padx=20, pady=16, bd = 4, fg = "black", font = ('arial', 15), text = "Logout", bg = "orange", command = lambda: controller.show_frame("LoginView")).grid(columnspa=3, row=8, column=1, sticky="ew")

        def buttonClick(numbers):
            global operator
            self.operator = self.operator + str(numbers)
            self.text_Input.set(self.operator)
            return;
            # shold pass choice password, and the password itself so that we can recall it later
        def OKClick(passChoice):
            global operator
        # get value and store in passChoice
            print(self.passChoice)
            # have an empty dictionary to save the password but not sure if it will create a new one each time....
            passwordKeys = {}
            # check that operator is not null
            if len(self.operator) > 0:
                passwordKeys = dict([(self.passChoice,self.operator)])
                print(passwordKeys)
            else:
                print('No value has been input')
                return;
        def DeleteClick():
            global operator
            self.operator = self.operator[:-1]
            self.text_Input.set(self.operator)
            return;

        def AddClick():
            global operator
            DC = Dictionary()
            DC.AddToArray(self.operator, list)
            DC.PrintList(list)
            self.operator = " "
            self.text_Input.set(self.operator)
            return;


class LoginView(tk.Frame):

    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller

        self.usernametext = tk.StringVar()
        self.username = ""
        self.passwordtext = tk.StringVar()
        self.password = ""

        label = tk.Label(self, text="Login Page", font=('ariel',35, 'bold'))
        label.grid(columnspan=4, row = 0, column = 1)

        UsernameLabel = tk.Label(self, font=('arial', 20), text="Username: ", fg = "Black", bd = 10, anchor = 'w')
        UsernameLabel.grid(columnspan=4, row = 1, column = 1)

        PasswordLabel = tk.Label(self, font=('arial', 20), text="Password: ", fg = "Black", bd = 10, anchor = 'w')
        PasswordLabel.grid(columnspan=4, row = 2, column = 1)

        LoginButton = tk.Button(self, text="Login",command=lambda: CheckCredentials())
        LoginButton.grid(columnspan=3, row = 7, column = 5, sticky = "ew")

        CreateButton = tk.Button(self, text="Create Account",command=lambda: CreateAccountClick())
        CreateButton.grid(columnspan=3, row = 7, column = 8, sticky = "ew")

        UsernameInput = tk.Entry(self, font=('arial', 15), textvariable = self.usernametext, bd = 6, insertwidth=4, bg = "white", justify = 'right')
        UsernameInput.grid(columnspan=6, row = 1, column = 5)

        PasswordInput = tk.Entry(self, font=('arial', 15), show="*", textvariable = self.passwordtext, insertwidth=6, bd = 6, bg = "white", justify = 'right')
        PasswordInput.grid(columnspan=6, row = 2, column = 5)


        ErrorLabel = tk.Label(self, font=('arial', 12), text="Incorrect Username or Password", fg = "Red", bd = 10, anchor = 'w')
        ErrorLabel.grid_forget()

        def CreateAccountClick():
            ErrorLabel.grid_forget()
            controller.show_frame("CreateAccountView")

        def CheckCredentials():
            LogDB = loginDB()
            username = UsernameInput.get()
            password = PasswordInput.get()
            if LogDB.CheckDBCred(username, password):
                print('login successful')
                controller.show_frame("MainView")
                self.usernametext.set(self.username)
                self.passwordtext.set(self.password)
            else:
                ErrorLabel.grid(columnspan=6, row = 4, column = 5, sticky="ew")
            LogDB.___del___()

class CreateAccountView(tk.Frame):

    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller

        self.causernametext = tk.StringVar()
        self.causername = ""
        self.capasswordtext = tk.StringVar()
        self.capassword = ""
        self.capasswordagaintext = tk.StringVar()
        self.capasswordagain = ""

        label = tk.Label(self, text="Create Your Account", font=('ariel',35, 'bold'))
        label.grid(columnspan=4, row = 0, column = 1)

        CAUsernameLabel = tk.Label(self, font=('arial', 20), text="Username: ", fg = "Black", bd = 10, anchor = 'w')
        CAUsernameLabel.grid(columnspan=4, row = 1, column = 1)

        CAPasswordLabel = tk.Label(self, font=('arial', 20), text="Password: ", fg = "Black", bd = 10, anchor = 'w')
        CAPasswordLabel.grid(columnspan=4, row = 2, column = 1)

        CADoneButton = tk.Button(self, text="Create",command=lambda: CreateAccount())
        CADoneButton.grid(columnspan=3, row = 7, column = 5, sticky = "ew")

        ExitButton = tk.Button(self, text="Back",command=lambda: controller.show_frame("LoginView"))
        ExitButton.grid(columnspan=3, row = 7, column = 8, sticky = "ew")

        CAUsernameInput = tk.Entry(self, font=('arial', 15), textvariable = self.causernametext, bd = 6, insertwidth=4, bg = "white", justify = 'right')
        CAUsernameInput.grid(columnspan=6, row = 1, column = 5)

        CAPasswordInput = tk.Entry(self, font=('arial', 15), show="*", textvariable = self.capasswordtext, insertwidth=6, bd = 6, bg = "white", justify = 'right')
        CAPasswordInput.grid(columnspan=6, row = 2, column = 5)

        CAPasswordAgainLabel = tk.Label(self, font=('arial', 20), text="Password: ", fg = "Black", bd = 10, anchor = 'w')
        CAPasswordAgainLabel.grid(columnspan=4, row = 3, column = 1)

        CAPasswordAgainInput = tk.Entry(self, font=('arial', 15), show="*", textvariable = self.capasswordagaintext, insertwidth=6, bd = 6, bg = "white", justify = 'right')
        CAPasswordAgainInput.grid(columnspan=6, row = 3, column = 5)


        UsernameTakenLabel = tk.Label(self, font=('arial', 12), text="Username Taken", fg = "Red", bd = 10, anchor = 'w')
        UsernameTakenLabel.grid_forget()

        PasswordNoMatchLabel = tk.Label(self, font=('arial', 12), text="Passwords Do Not Match", fg = "Red", bd = 10, anchor = 'w')
        PasswordNoMatchLabel.grid_forget()

        def CreateAccount():
            LogDB = loginDB()
            username = CAUsernameInput.get()
            password = <PASSWORD>()
            passwordagain = <PASSWORD>.get()
            UsernameTakenLabel.grid_forget()
            PasswordNoMatchLabel.grid_forget()
            if LogDB.CheckDBUser(username):
                UsernameTakenLabel.grid(columnspan=6, row = 5, column = 5, sticky="ew")
                return
            if not LogDB.CheckDBUser(username) and password == <PASSWORD>:
                LogDB.addUser(username, password)
                controller.show_frame("LoginView")
                self.causernametext.set(self.causername)
                self.capasswordtext.set(self.capassword)
                self.capasswordagaintext.set(self.capasswordagain)
            else:
                PasswordNoMatchLabel.grid(columnspan=6, row = 5, column = 5, sticky="ew")
            LogDB.___del___()


if __name__ == "__main__":
    root = MyApplication()
    root.wm_geometry("1500x1000")
    root.title("My Application")
    root.mainloop()
<file_sep>/source.py
print('hello World! Time to learn a new language\n \n')
import pygame
# constant global variables
S_WIDTH = 500
S_HEIGHT = 500
BLACK = (255,255,255)
BLUE_HUE = (29,109,194)
# create an object to help maintain time using Clock
time_interval = pygame.time.Clock()
screen = 'First display Test'
class StartScreen(object):
    """docstring for StartScreen."""
    # Update the clock also refers to frame rate
    time_rate = 60 #fps
    # global variable to hold in the user input
    user_input = ''
    def __init__(self, mScreenTitle,mWidth,mHeight):
        self.mScreenTitle = mScreenTitle
        self.mWidth = mWidth
        self.mHeight = mHeight
        # display blue hue by creating a display with specified WxH
        self.screen = pygame.display.set_mode((S_WIDTH,S_HEIGHT))
        self.screen.fill(BLUE_HUE)
        #name of the screen
        pygame.display.set_caption(mScreenTitle)
    def loadScreen(self):
        END_DISPLAY = False
        font = pygame.font.Font(None,50)
        while not END_DISPLAY:
            # we get all events that are occurring, ie mouse clicks, keyboard strokes etc
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    END_DISPLAY = True
                    # check if the event is a keystroke
                elif event.type == pygame.KEYDOWN:
                    # check if the keystroke is a alphabet and if it is then store to user_input
                    if event.unicode.isalpha():
                        self.user_input += event.unicode
                    # if enter is pressed clear user input then refill the screen with the same color
                    elif event.key == pygame.K_RETURN:
                        self.user_input = ''
                        self.screen.fill(BLUE_HUE)
            # using the font from pygame render the input from the user
            block = font.render(self.user_input,True,BLACK)
            inputBox = block.get_rect()
            self.screen.blit(block,inputBox)
            # as long as the while loop is running we need to show and update the display as well as keep up with the time using .tick()
            pygame.display.update()
            time_interval.tick(self.time_rate)
# NOTE: after importing pygame, initialize pygame
pygame.init()
# CREATE a new object from the class StartScreen and pass in the necessary values for the __init__
newScreen = StartScreen(screen,S_WIDTH,S_HEIGHT)
# call the loadScreen on the variable created from the StartScreen class
newScreen.loadScreen()
# we need to end pygame and quit
pygame.quit()
quit()
<file_sep>/MyApp/LoginDataBase.py
import sqlite3

class loginDB():

    def __init__(self):
        #Initialize db class variables
        self.connection = sqlite3.connect('LoginCredentials.db')
        self.cur = self.connection.cursor()


    def ___del___(self):
        #close sqlite3 connection
        self.connection.close()

    def addUser(self, newUserName, newPassword):
        with self.connection:
            self.cur.execute(" INSERT INTO LoginInfo VALUES (:username, :password)", {'username': newUserName, 'password': newPassword})
            self.connection.commit()

    def CheckDBUser(self, userID):
        self.cur.execute("SELECT * FROM LoginInfo WHERE username=:username", {'username': userID})
        return self.cur.fetchall()

    def CheckDBCred(self, userID, passCode):
        self.cur.execute("SELECT * FROM LoginInfo WHERE username=:username AND password=:password", {'username': userID, 'password':passCode})
        return self.cur.fetchall()

    def DeleteUser(self, userID, passCode):
        with self.connection:
            self.cur.execute("DELETE from LoginInfo WHERE username=:username AND password=:password", {'username': userID, 'password':passCode})
            self.connection.commit()

    def commit(self):
        #commit changes to database
        self.connection.commit()



# conn = sqlite3.connect('LoginCredentials.db')

# cursor = conn.cursor()

## create a table now

# cursor.execute("""CREATE TABLE LoginInfo (
#     username text,
#     password text
# )""")

##ADD data to table
# cursor.execute(" INSERT INTO LoginInfo VALUES ('hamzam', '9035712357')")
# cursor.execute(" INSERT INTO LoginInfo VALUES ('freddiev', '4692267036')")
# conn.commit()
##run query
# cursor.execute("SELECT * FROM LoginInfo WHERE username='hamzam'")

##three ways to cycle through query
## 1. fetchone()  --- gets the first occurance
## 2. fetchmany(*int*) --- gets that many occurances
## 3. fetchall() --- gets all the occurancs

# print(cursor.fetchone()[1])

# conn.commit() ## commits the current changes


# conn.close() ##good to close connection at end
