Advertisement
Lydss

Untitled

Oct 26th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. ##Imports##
  2. import random
  3. import sqlite3
  4. import tkinter
  5. from tkinter import *
  6. import time
  7. import string
  8.  
  9. root = tkinter.Tk()
  10. root.geometry("600x600")
  11. mainmenu = tkinter.Toplevel1()
  12. conn = sqlite3.connect("Guest_data.db")
  13. c= conn.cursor()
  14.  
  15. ######################################################################
  16.  
  17. def create_table():
  18. c.execute("CREATE TABLE IF NOT EXISTS guestdata(firstname TEXT, adress TEXT, email TEXT, phonenumber REAL, age REAL)")
  19.  
  20. def main_menu():
  21. root.geometry("600x600")
  22. mainmenu.deiconify()
  23.  
  24. ##login word and entry##
  25. username = Label(root,text = 'Username:'),font=('Comic Sans MS', 14), bd=15.place(x=0,y=0)
  26. usernameentry = Entry(root).place(x=108,y=20)
  27. password = Label(root,text = 'Pasword:',font=('Comic Sans MS', 14), bd=15.place(x=0,y=45)
  28. paswordentry = Entry(root).place(x=108,y=63)
  29.  
  30. ##Login System##
  31. username="Admin"
  32. password="Staff"
  33.  
  34. def trylogin():
  35. if username == username_entry.get()and password == password_entry.get():
  36. root.withdraw()
  37. login.deiconfiy()
  38. else:
  39. print("Wrong")
  40.  
  41. button=Button(root,text="enter",command=trylogin)
  42. button.place(x=135,y=57)
  43.  
  44.  
  45. ##Main Menu##
  46. nextbtn = tkinter.Button(root, text = "Next", command = main_menu).place(x=235,y=57)
  47. mainmenulbl = tkinter.Label(mainmenu, Text = 'Welcome to main menu',font=('Comic Sans MS', 14), bd=15).place(x=0,y=60)
  48.  
  49. mainmenu.withdraw()
  50. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement