Im trying to enter to the menu window but whenever I do so I get the cant invoke frame command. I am not sure if there is an error regarding with my .mainloop() function
Here is my login code
class Login:
global user
global pwd
def __init__(self,root):
self.root = root
self.root.title("Scheduling Management System")
self.root.geometry("1350x768+0+0")
self.root.resizable(False, False)
self.txt_user = StringVar()
self.txt_pass = StringVar()
self.bg = ImageTk.PhotoImage(file="Images/bgimage.jpg")
bg = Label(self.root, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
framelogin = Frame(self.root, bg="white")
framelogin.place(x=450, y=100, height=500, width=700)
registerbutton = Button(framelogin, text="Sign Up", command=self.register, bg="white", fg="orange",
font=("trebuchet ms", 12)).place(x=510, y=305)
loginbutton = Button(framelogin, text="Login", command=self.login, fg="white", bg="orange",
font=("sans serif ms", 20)).place(x=90, y=350, width="100", height="40")
def login(self):
global con
user = self.txt_user.get().strip()
pwd = self.txt_pass.get().strip()
if user == "" or pwd == "":
messagebox.showerror("Error", "Please fill up all fields!")
else:
try :
con=pymysql.connect(host="localhost",user="root",password="",database="employee")
cur=con.cursor()
cur.execute("select 1 from employeelist where username=%s and password=%s", (user,pwd))
if cur.rowcount == 1:
messagebox.showinfo("Success", "Login Successful", parent=self.root)
self.menu()
else:
messagebox.showerror("Error", "Wrong Username or Password. Please try again!")
except Exception as ex:
messagebox.showerror("Error",f"Error due to: {str(ex)}",parent=self.root)
finally:
con.close()
def register(self):
self.root.destroy()
register.RegisterForm()
def menu(self):
self.root.destroy()
menu.MenuForm()
def LoginForm():
win = Tk()
obj = Login(win)
if __name__ == "__main__":
root = Tk()
obj = Login(root)
root.mainloop()
Here is my menu code
from tkinter import *
from tkinter import ttk, messagebox
import PIL
from PIL import ImageTk
from PIL import Image
import login
class Menu:
def __init__(self,root):
self.root = root
self.root.title("Main Menu")
self.root.geometry("1350x768+0+0")
self.bg = ImageTk.PhotoImage(file="Images/bgimage.jpg")
bg = Label(self.root, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
framemenu = Frame(self.root, bg="white")
framemenu.place(x=450, y=100, height=500, width=700)
welcometitle = Label(framemenu, text="Welcome " + login.Login.user, font=("Arial", 30, "bold"), fg="orange", bg="white").place(x=470,
y=120)
def MenuForm():
win = Tk()
obj = Menu(win)
if __name__ == "__main__":
root = Tk()
obj = Menu(root)
root.mainloop()
I cant seem to identify the issue as Im trying to redirect the users once it has login to the menu page
Related
This code is supposed to ask login information from the user. Then when it enters the wrong details, it will do a popup (loginErrorWdw) with a label and a button. The button there will exit the program when pressed.
I'm trying to get the button from loginErrorWdw to appear in that window but it won't. Here's my whole block of code.
from tkinter.ttk import *
from tkinter import messagebox
import tkinter as tk
import sys
import os
class Login(Frame):
def __init__(self,master):
Frame.__init__(self,master)
self.grid()
self.loginWidgets()
def loginWidgets(self):
self.userlbl = Label(self, text="Enter username: ")
self.userlbl.grid()
self.unEntry = Entry(self)
self.unEntry.grid(row=0, column=1, sticky=W)
self.pwlbl = Label(self, text="Enter password: ")
self.pwlbl.grid(row=1, column=0, sticky=W)
self.pwEntry = Entry(self, show="*")
self.pwEntry.grid(row=1, column=1, sticky=W)
self.submitBtn = Button(self, text="LOGIN", command=self.checkLogin)
self.submitBtn.grid(row=2, column=1, sticky=W)
def loginErrorWdw(self):
err = tk.Toplevel(self)
err.title("Error")
l = tk.Label(err, text="Invalid login details! The program will exit.")
l.pack(side="top", expand=False, padx=20, pady=20)
btn=tk.Button(err, text="Ok", command=self.exitBtn)
def exitBtn(self):
os._exit(0)
#change def position
def mainWdw(self):
messagebox.showinfo('Main window','Message pop up')
def checkLogin(self):
user = self.unEntry.get()
pw = self.pwEntry.get()
if user == "admin":
if pw == "lbymf1d":
self.mainWdw()
else:
self.loginErrorWdw()
else:
self.loginErrorWdw()
# un = admin, pw = lbymf1d
#window = var
window = Tk()
window.title("Login UI")
# window size
window.geometry('700x300')
login = Login(window)
# loop for window
window.mainloop()
You forgot about btn.pack()
This is way without errors:
from tkinter.ttk import *
from tkinter import messagebox
import tkinter as tk
import sys
# import os
class Login(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.loginWidgets()
def loginWidgets(self):
self.userlbl = Label(self, text="Enter username: ")
self.userlbl.grid()
self.unEntry = Entry(self)
self.unEntry.grid(row=0, column=1, sticky="W") # sticky must be string
self.pwlbl = Label(self, text="Enter password: ")
self.pwlbl.grid(row=1, column=0, sticky="W")
self.pwEntry = Entry(self, show="*")
self.pwEntry.grid(row=1, column=1, sticky="W")
self.submitBtn = Button(self, text="LOGIN", command=self.checkLogin)
self.submitBtn.grid(row=2, column=1, sticky="W")
def loginErrorWdw(self):
err = tk.Toplevel(self)
err.title("Error")
l = tk.Label(err, text="Invalid login details! The program will exit.")
l.pack(side="top", expand=False, padx=20, pady=20)
btn = tk.Button(err, text="Ok", command=self.exitBtn)
btn.pack() # Draw it
def exitBtn(self):
sys.exit(0) # Exit
# change def position
def mainWdw(self):
messagebox.showinfo('Main window', 'Message pop up')
def checkLogin(self):
user = self.unEntry.get()
pw = self.pwEntry.get()
if user == "admin":
if pw == "lbymf1d":
self.mainWdw()
else:
self.loginErrorWdw()
else:
self.loginErrorWdw()
# un = admin, pw = lbymf1d
# window = var
window = tk.Tk()
window.title("Login UI")
# window size
window.geometry('700x300')
login = Login(window)
# loop for window
window.mainloop()
i'm working on a login system, so i made the display with two buttons Login and Sign up button so i want to make a new page appears when the user clicks one the buttons for example if he clicks on Login the page will update to a page with entry boxes of the credentials and the same thing with the sign up button i need some ideas how to do it i'm somehow beginner in Tkinter, Here is my code :
from tkinter import *
root = Tk()
root.title("Login System")
root.geometry('550x300')
root.configure(bg="Black")
home_label = Label(root,text="Welcome",font=("Helvatica",32),fg="White",bg="Black")
home_label.pack(pady=30)
login = Button(root,text="Login",font=("Nexa",22),bg="White",fg="Black",width=10)
login.pack(pady=0)
signup = Button(root,text="Sign UP",font=("Nexa",22),bg="White",fg="Black",width=10)
signup.pack(pady=5)
root.mainloop()
Here is a simple one with a TopLevel()
import tkinter as tk
from tkinter.simpledialog import askstring
from tkinter import *
import os
import re
#Designing window for registration
def register():
global register_screen
register_screen = Toplevel(main_screen)
register_screen.title("Register")
register_screen.geometry("300x250")
#Globalling variables
global username
global password
global username_entry
global password_entry
global invLbl
username = StringVar()
password = StringVar()
#Labels and entry fields for register screen
invLbl = Label(register_screen, text="", fg="red", font=("calibri", 11))
Label(register_screen, text="Please enter details below", bg="blue").pack()
Label(register_screen, text="").pack()
username_lable = Label(register_screen, text="Username * ")
username_lable.pack()
username_entry = Entry(register_screen, textvariable=username)
username_entry.pack()
password_lable = Label(register_screen, text="Password * ")
password_lable.pack()
password_entry = Entry(register_screen, textvariable=password, show='*')
password_entry.pack()
Label(register_screen, text="").pack()
Button(register_screen, text="Register", width=10, height=1, bg="blue", command = register_user).pack()
invLbl.pack()
#Designing window for login
def login():
global login_screen
login_screen = Toplevel(main_screen)
login_screen.title("Login")
login_screen.geometry("300x250")
Label(login_screen, text="Please enter details below to login").pack()
Label(login_screen, text="").pack()
global username_verify
global password_verify
username_verify = StringVar()
password_verify = StringVar()
global username_login_entry
global password_login_entry
Label(login_screen, text="Username * ").pack()
username_login_entry = Entry(login_screen, textvariable=username_verify)
username_login_entry.pack()
Label(login_screen, text="").pack()
Label(login_screen, text="Password * ").pack()
password_login_entry = Entry(login_screen, textvariable=password_verify, show= '*')
password_login_entry.pack()
Label(login_screen, text="").pack()
Button(login_screen, text="Login", width=10, height=1, command = login_verify).pack()
#Implementing event on register button
def register_user():
username_info = username.get()
password_info = password.get()
valid = True
for char in username_info:
if char.isdigit() == True:
valid = False
#If there is a for example a number iin the username, this error message will be printed.
invLbl.config(text="Invalid Username")
if username_info == '':
valid = False
#If the username is left blank, this error message will be printed.
invLbl.config(text="Enter a Username")
#Password Validation
if len(password_info) <3 or len(password_info) > 16:
valid = False
invLbl.config(text="Ensure password is not less than 3 or greater than 16 digits.")
if valid == True:
file = open(username_info, "w")
file.write(username_info + "\n")
file.write(password_info)
file.close()
#Registration Success Message
invLbl.config(text="Registration Success!", fg="green")
username_entry.delete(0, END)
password_entry.delete(0, END)
#Implementing event on login button
def login_verify():
username1 = username_verify.get()
password1 = password_verify.get()
username_login_entry.delete(0, END)
password_login_entry.delete(0, END)
list_of_files = os.listdir()
if username1 in list_of_files:
file1 = open(username1, "r")
verify = file1.read().splitlines()
if password1 in verify:
login_sucess()
else:
password_not_recognised()
else:
user_not_found()
#Designing popup for login success
def login_sucess():
global login_success_screen
login_success_screen = Toplevel(login_screen)
login_success_screen.title("Success")
login_success_screen.geometry("150x100")
Label(login_success_screen, text="Login Success").pack()
Button(login_success_screen, text="OK", command=delete_login_success).pack()
#Designing popup for login invalid password
def password_not_recognised():
global password_not_recog_screen
password_not_recog_screen = Toplevel(login_screen)
password_not_recog_screen.title("Success")
password_not_recog_screen.geometry("150x100")
Label(password_not_recog_screen, text="Invalid Password ").pack()
Button(password_not_recog_screen, text="OK", command=delete_password_not_recognised).pack()
#Designing popup for user not found
def user_not_found():
global user_not_found_screen
user_not_found_screen = Toplevel(login_screen)
user_not_found_screen.title("Success")
user_not_found_screen.geometry("150x100")
Label(user_not_found_screen, text="User Not Found").pack()
Button(user_not_found_screen, text="OK", command=delete_user_not_found_screen).pack()
#Deleting popups
def delete_login_success():
login_success_screen.destroy()
login_screen.destroy()
def delete_password_not_recognised():
password_not_recog_screen.destroy()
def delete_user_not_found_screen():
user_not_found_screen.destroy()
#Designing Main(first) window
def main_account_screen():
global main_screen
main_screen = Tk()
main_screen.geometry("300x250")
main_screen.title("Account Login")
Label(text="Select Your Choice", bg="blue", width="300", height="2", font=("Calibri", 13)).pack()
Label(text="").pack()
Button(text="Login", height="2", width="30", command = login).pack()
Label(text="").pack()
Button(text="Register", height="2", width="30", command=register).pack()
main_screen.mainloop()
main_account_screen()
I assume we can handle this with different methods one of them to create a frame and destroy it when button used, other way to merge different pages and use this button to navigate between them .
import Tkinter as tk
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)
label = tk.Label(self, text="This is page 1")
label.pack(side="top", fill="both", expand=True)
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.show)
b2 = tk.Button(buttonframe, text="Page 2", command=p2.show)
b3 = tk.Button(buttonframe, text="Page 3", command=p3.show)
b1.pack(side="left")
b2.pack(side="left")
b3.pack(side="left")
p1.show()
if __name__ == "__main__":
root = tk.Tk()
main = MainView(root)
main.pack(side="top", fill="both", expand=True)
root.wm_geometry("400x400")
root.mainloop()
as you can see they have merged on mainView and button has lift attitude with show function. I hope it works for you.
Im trying to close my login wondow and open my register window once I click the sign up button but it doesn't destroy the login window
Here is my login code
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import PIL
from PIL import ImageTk
from PIL import Image
import register
import pymysql
class Login:
def __init__(self,root):
self.root = root
self.root.title("Scheduling Management System")
self.root.geometry("1350x768+0+0")
self.root.resizable(False, False)
self.txt_user = StringVar()
self.txt_pass = StringVar()
self.bg = ImageTk.PhotoImage(file="Images/bgimage.jpg")
bg = Label(self.root, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
framelogin = Frame(self.root, bg="white")
framelogin.place(x=450, y=100, height=500, width=700)
title = Label(framelogin, text="Login Here", font=("Arial", 30, "bold"), fg="orange", bg="white").place(x=90,
y=30)
nexttitle = Label(framelogin, text="Scheduling Staff System", font=("Times New Roman", 18, "bold"), fg="orange",
bg="white").place(x=90, y=100)
userlabel = Label(framelogin, text="Username", font=("Arial", 15, "bold"), fg="gray", bg="white").place(x=90,
y=140)
self.txt_user = Entry(framelogin, textvariable=self.txt_user, font=("times new roman", 15), bg="lightgray")
self.txt_user.place(x=90, y=170, width=350, height=35)
passlabel = Label(framelogin, text="Password", font=("Arial", 15, "bold"), fg="gray", bg="white").place(x=90,
y=210)
self.txt_pass = Entry(framelogin, textvariable=self.txt_pass, font=("times new roman", 15), show="*",
bg="lightgray")
self.txt_pass.place(x=90, y=240, width=350, height=35)
forget = Button(framelogin, text="Forgot Password", bg="white", fg="orange", font=("trebuchet ms", 12)).place(
x=90, y=305)
reglabel = Label(framelogin, text="Don't Have an Account?", font=("trebuchet ms", 12, "bold"), fg="orange",
bg="white").place(x=320, y=310)
registerbutton = Button(framelogin, text="Sign Up", command=self.register, bg="white", fg="orange",
font=("trebuchet ms", 12)).place(x=510, y=305)
loginbutton = Button(framelogin, text="Login", command=self.login, fg="white", bg="orange",
font=("sans serif ms", 20)).place(x=90, y=350, width="100", height="40")
def login(self):
if self.txt_user.get() == "" or self.txt_pass.get() == "":
messagebox.showerror("Error", "Please fill up all fields!")
def register(self):
register.RegisterForm()
if __name__ == "__main__":
root = Tk()
obj = Login(root)
root.mainloop()
Here is my register code
from tkinter import *
from tkinter import ttk, messagebox
import PIL
import pymysql
from PIL import ImageTk
from PIL import Image
import login
class Register:
def __init__(self, root):
self.root = root
...
btn = Button(frame1,image=self.btn, bd=0, command = self.registerdata,cursor = "hand2").place(x=50, y = 420)
def registerdata(self):
if self.text_fname.get()=="" or self.text_lname.get()=="" or self.text_contact.get()=="" or self.text_email.get()=="" or self.cmbquestion.get()=="Select" or self.text_pwd.get()=="" or self.text_cfmpwd.get()=="":
messagebox.showerror("Error","All fields are required!",parent=self.root)
elif self.text_pwd.get()!=self.text_cfmpwd.get():
messagebox.showerror("Error","Passwords must be the same!",parent=self.root)
else:
try:
con=pymysql.connect(host="localhost",user="root",password="",database="employee")
cur=con.cursor()
cur.execute("select * from employeelist where email=%s", self.text_email.get())
row=cur.fetchone()
print(row)
if row!=None:
messagebox.showerror("Error","User Already Exists. Please Register With a New Email",parent=self.root)
else:
cur.execute("insert into employeelist (fname,lname,contact,email,question,answer,password) values(%s,%s,%s,%s,%s,%s,%s)",
(self.text_fname.get(),self.text_lname.get(),self.text_contact.get(),self.text_email.get(),self.cmbquestion.get(),self.text_answer.get(),self.text_pwd.get()))
con.commit() #do changes to database
con.close()
messagebox.showinfo("Success","Registration Successful",parent=self.root)
except Exception as ex:
messagebox.showerror("Error",f"Error due to: {str(ex)}",parent=self.root)
l = login
l.Login(root)
def RegisterForm():
win = Toplevel()
obj = Register(win)
if __name__ == "__main__":
root = Tk()
obj = Register(root)
root.mainloop()
Any ideas on how to do so as currently I'm only able to see both windows instead of destroying login window and opening register window?
Firstly add self.root.destroy() to the register method in the login file.
This will destroy the login Tk instance.
To avoid the extra window when the register window opens, change win = Toplevel() in RegisterForm to win = Tk(). Toplevel needs a Tk window so it made an extra window, so we need to create a Tk instance instead.
I am writing a code for a login system using tkinter and for some reason when I run the code there are no error messages and a window pops up but without the title, buttons or labels I need.
from tkinter import *
import tkinter.messagebox
frame = Tk()
def adminlogincheck(self, master):
frame = Frame(master)
frame.pack()
if username == '123key' and password == 'key123':
accept = Label(frame, text='Login Successful')
else:
decline = Label(frame, text='Login incorrect')
mainloop()
def adminselect(self, master):
frame = Frame(master)
frame.pack()
self.button = Button(frame, text="Cancel", fg="red", command=quit)
self.button.pack(side=LEFT)
self.slogan = Button(frame, text="Proceed", command=self.adminlogin)
self.slogan.pack(side=LEFT)
mainloop()
def adminlogin(self, master):
frame = Frame(master)
frame.pack()
username_entry = Entry(frame)
password_entry = Entrey(frame)
confirm = Button(frame, text='Login', command = adminlogincheck)
loginquit = Button(frame, text='Cancel', command=quit)
mainloop()
I will add more after the login system works but does anyone know why no buttons or labels appear?
There's enough in your request to see what you're trying to accomplish, but there are many issues with the code. Here is a working model of what you appear to be working toward...
from tkinter import *
import tkinter.messagebox
class Admin:
def __init__(self, master):
self.frame = Frame(master)
self.frame.pack()
self.username = StringVar()
self.password = StringVar()
def logincheck(self):
self.clearframe()
if self.username.get() == '123key' and self.password.get() == 'key123':
accept = Label(self.frame, text='Login Successful')
accept.pack(side=LEFT)
else:
decline = Label(self.frame, text='Login incorrect')
decline.pack(side=LEFT)
def select(self):
self.clearframe()
self.button = Button(self.frame, text="Cancel", fg="red", command=quit)
self.button.pack(side=LEFT)
self.slogan = Button(self.frame, text="Proceed", command=self.adminlogin)
self.slogan.pack(side=LEFT)
def login(self):
self.clearframe()
username_entry = Entry(self.frame, textvariable=self.username)
username_entry.pack()
password_entry = Entry(self.frame, textvariable=self.password)
password_entry.pack()
confirm = Button(self.frame, text='Login', command = self.logincheck)
confirm.pack()
loginquit = Button(self.frame, text='Cancel', command=quit)
loginquit.pack()
def clearframe(self):
# Destroy all children of the class's frame.
for child in self.frame.winfo_children():
child.destroy()
root = Tk()
admin = Admin(root)
admin.login()
mainloop()
I am not familiar with python and creating user login entry window to login to the another window. The problem is that how can I make sure that it is logged in after entering correct username and password. I could go to the window that I want to login by entering the username and password but I think the coding is still not correct. Another thing is that when the login window pop up, if the user just close the window without entering username and password, the program should just quit. However it still continues to go to the window. Below is my code.
Thank you very much in advance
import Tkinter
from Tkinter import Tk, Text, BOTH, W, N, E, S
from ttk import Frame, Button, Label, Style
class MainWindow(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
self.parent.title("AUTO TIPS")
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(3, pad=7)
self.rowconfigure(3, weight=1)
self.rowconfigure(5, pad=7)
lbl = Label(self, text="Status")
lbl.grid(sticky=W, pady=4, padx=5)
area = Text(self)
area.grid(row=1, column=0, columnspan=2, rowspan=4, padx=5, sticky=E+W+S+N)
abtn = Button(self, text="Drive Command", command=win3)
abtn.grid(row=1, column=3)
cbtn = Button(self, text="Tester Manual Control", command=win2)
cbtn.grid(row=2, column=3, pady=4)
dbtn = Button(self, text="Auto Run", command=AutoTIPS)
dbtn.grid(row=3, column=3, pady=4)
obtn = Button(self, text="OK", command=self.parent.destroy)
obtn.grid(row=5, column=3)
####################################################################################################################################################
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
failure_max = 3
passwords = [('Aung', 'Aung')]
def make_entry(parent, caption, width=None, **options):
tk.Label(parent, text=caption).pack(side=tk.TOP)
entry = tk.Entry(parent, **options)
if width:
entry.config(width=width)
entry.pack(side=tk.TOP, padx=10, fill=tk.BOTH)
return entry
def enter(event):
check_password()
def check_password(failures=[]):
# Collect 1's for every failure and quit program in case of failure_max failures
print(user.get(), password.get())
if (user.get(), password.get()) in passwords:
root.destroy()
print('Logged in')
return
failures.append(1)
if sum(failures) >= failure_max:
root.destroy()
raise SystemExit('Unauthorized login attempt')
else:
root.title('Try again. Attempt %i/%i' % (sum(failures)+1, failure_max))
root = tk.Tk()
root.geometry('300x160')
root.title('Enter your information')
#frame for window margin
parent = tk.Frame(root, padx=10, pady=10)
parent.pack(fill=tk.BOTH, expand=True)
#entrys with not shown text
user = make_entry(parent, "User name:", 16, show='')
password = make_entry(parent, "Password:", 16, show="*")
#button to attempt to login
b = tk.Button(parent, borderwidth=4, text="Login", width=10, pady=8, command=check_password)
b.pack(side=tk.BOTTOM)
password.bind('<Return>', enter)
user.focus_set()
parent.mainloop()
####################################################################################################################################################
def win2():
board = Tkinter.Toplevel()
board.title("Tester Manual Control")
s1Var = Tkinter.StringVar()
s2Var = Tkinter.StringVar()
s3Var = Tkinter.StringVar()
s4Var = Tkinter.StringVar()
s5Var = Tkinter.StringVar()
s6Var = Tkinter.StringVar()
s7Var = Tkinter.StringVar()
s8Var = Tkinter.StringVar()
s1Var.set(" Tester 1")
s2Var.set(" Tester 2")
s3Var.set(" Tester 3")
s4Var.set(" Tester 4")
s5Var.set(" Tester 5")
s6Var.set(" Tester 6")
s7Var.set(" Tester 7")
s8Var.set(" Tester 8")
square1Label = Tkinter.Label(board,textvariable=s1Var)
square1Label.grid(row=1, column=500)
square2Label = Tkinter.Label(board,textvariable=s2Var)
square2Label.grid(row=2, column=500)
square3Label = Tkinter.Label(board,textvariable=s3Var)
square3Label.grid(row=3, column=500)
square4Label = Tkinter.Label(board,textvariable=s4Var)
square4Label.grid(row=4, column=500)
square5Label = Tkinter.Label(board,textvariable=s5Var)
square5Label.grid(row=5, column=500)
square6Label = Tkinter.Label(board,textvariable=s6Var)
square6Label.grid(row=6, column=500)
square7Label = Tkinter.Label(board,textvariable=s7Var)
square7Label.grid(row=7, column=500)
square8Label = Tkinter.Label(board,textvariable=s8Var)
square8Label.grid(row=8, column=500)
####################################################################################################################################################
def win3():
board = Tkinter.Toplevel()
board.title("Drive Command")
codeloadButton = Tkinter.Button(board, text="Code Load", command=win4)
codeloadButton.grid(row=100, column=50)
clearButton = Tkinter.Button(board, text="Clear Dos Table", command=win5)
clearButton.grid(row=500, column=50)
####################################################################################################################################################
def win4():
board = Tkinter.Toplevel()
board.title("Code Load")
####################################################################################################################################################
def win5():
board = Tkinter.Toplevel()
board.title("Clear Dos Table")
####################################################################################################################################################
def main():
root = Tk()
root.geometry("350x300+300+300")
app = MainWindow(root)
root.mainloop()
if __name__ == '__main__':
main()