-
Notifications
You must be signed in to change notification settings - Fork 1
/
tkinter.py
60 lines (49 loc) · 1.32 KB
/
tkinter.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
import Tkinter
import tkMessageBox
import os
import subprocess
top = Tkinter.Tk()
canvas_width = 500
canvas_height = 200
w = Tkinter.Canvas(top,
width=canvas_width,
height=canvas_height)
w.pack()
top.title("Lock System".center(100))
def helloCallBack1():
os.system('python capture-positives.py')
print("hi")
os.system('python train.py')
print("hello")
os.system('python facerecog.py')
print("hi hi")
def helloCallBack2():
print("resume ")
os.system('python facerecog.py')
def helloCallBack3():
#deletion
os.system('rm -R training/positive')
print("hi")
os.system('rm capture.pgm')
print("hello")
os.system('rm mean.png')
print("hi")
os.system('rm positive_eigenface.png')
print("hello")
os.system('rm negative_eigenface')
os.system('rm training.xml')
print("hi hi")
#start again
helloCallBack1()
def helloCallBack4():
top.destroy()
#print("hi hi")
B1 = Tkinter.Button(top, text ="Start",width=25,bg="green",fg="white", command = helloCallBack1)
B2 = Tkinter.Button(top, text ="Resume", width=25,bg="yellow",fg="black",command = helloCallBack2)
B3 = Tkinter.Button(top, text ="Reset", width=25,bg="blue",fg="white",command = helloCallBack3)
B4 = Tkinter.Button(top, text ="Quit", width=25,bg="red",fg="white",command = helloCallBack4)
B1.pack()
B2.pack()
B3.pack()
B4.pack()
top.mainloop()