-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui_main.py
84 lines (52 loc) · 2.08 KB
/
gui_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 18 16:37:36 2021
@author: sheet
"""
import sqlite3
import tkinter as tk
from tkinter import *
import time
import numpy as np
import os
from PIL import Image # For face recognition we will the the LBPH Face Recognizer
from PIL import Image , ImageTk
root = tk.Tk()
#root.geometry('500x500')
#root.title("Login Form")
#------------------------------------------------------
root.configure(background="seashell2")
#root.geometry("1300x700")
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
root.geometry("%dx%d+0+0" % (w, h))
root.title("GUI")
#------------------Frame----------------------
image2 =Image.open('im3.jpg')
image2 =image2.resize((w,h), Image.ANTIALIAS)
background_image=ImageTk.PhotoImage(image2)
background_label = tk.Label(root, image=background_image)
background_label.image = background_image
background_label.place(x=0, y=0) #, relwidth=1, relheight=1)
#-------function------------------------
def reg():
##### tkinter window ######
print("reg")
from subprocess import call
call(["python", "face_registartion.py"])
def login():
##### tkinter window ######
print("log")
from subprocess import call
call(["python", "admin_login.py"])
#++++++++++++++++++++++++++++++++++++++++++++
#####For background Image
lbl = tk.Label(root, text="Smart Online Voting System", font=('times', 40,' bold '), height=1, width=50,bg="black",fg="white")
lbl.place(x=0, y=5)
framed = tk.LabelFrame(root, text=" --WELCOME-- ", width=500, height=250, bd=5, font=('times', 14, ' bold '),bg="pink")
framed.grid(row=0, column=0, sticky='nw')
framed.place(x=400, y=200)
#++++++++++++++++++++++++++++++++++++++++++++
#####For background Image
button1 = tk.Button(framed, text='Admin',width=15,height=3,bg='dark blue',fg='white',command=login,font='bold').place(x=20,y=50)
button1 = tk.Button(framed, text='User',width=17,height=3,bg='dark blue',fg='white',command=reg,font='bold').place(x=250,y=50)
root.mainloop()