-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.py
49 lines (36 loc) · 1.44 KB
/
start.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
from tkinter import Tk, filedialog, Button, Label
import people_counter as pc
import datetime
import pl
import os
class Movie:
filenameOpen = ""
filenameSave = ""
def openFile(self):
self.filenameOpen = filedialog.askopenfilename(initialdir=os.getcwd(),
title="example_01",
filetypes=(("Video files", "*.mp4"), ("all files", "*.*")))
print(self.filenameOpen)
def saveFile(self):
self.filenameSave = filedialog.asksaveasfilename(initialdir=os.getcwd(),
title="output_01",
filetypes=(("Video files", "*.mp4"), ("all files", "*.*")))
print(self.filenameSave)
def start(self):
info, stat = pc.counter(self.filenameOpen, self.filenameSave)
currentDate = datetime.datetime.today()
pl.graph(stat)
def main():
root = Tk()
root.title("People counter")
root.minsize(width=1280, height=1024)
obj = Movie()
button1 = Button(root, text="Open Me!", command=obj.openFile)
button1.place(x=10, y=10)
button2 = Button(root, text="Save Me!", command=obj.saveFile)
button2.place(x=80, y=10)
button3 = Button(root, text="Count", command=obj.start)
button3.place(x=150, y=10)
root.mainloop()
if __name__ == "__main__":
main()