-
Notifications
You must be signed in to change notification settings - Fork 4
/
alert.py
27 lines (23 loc) · 1.4 KB
/
alert.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
import tkinter.messagebox
from datetime import *
alert_list = []
alert_count = [0, 0, 0, 0]
def print_alert(case): # 부정행위 감지 시 alert
now = datetime.now()
if case == 1:
tkinter.messagebox.showinfo("Alert", "두 명 이상 감지되었습니다.")
alert_count[0] += 1
alert_list.append("alert log[2명이상] : %s년 %s월 %s일 %s시 %s분 %s초.%s" % (now.year, now.month, now.day, now.hour, now.minute, now.second, now.microsecond))
elif case == 2:
tkinter.messagebox.showinfo("Alert", "고개 돌림이 감지되었습니다.")
alert_count[1] += 1
alert_list.append("alert log[고개돌림] : %s년 %s월 %s일 %s시 %s분 %s초.%s" % (now.year, now.month, now.day, now.hour, now.minute, now.second, now.microsecond))
elif case == 3:
alert_count[2] += 1
tkinter.messagebox.showinfo("Alert", "대화가 감지되었습니다.")
alert_list.append("alert log[대화] : %s년 %s월 %s일 %s시 %s분 %s초.%s" % (now.year, now.month, now.day, now.hour, now.minute, now.second, now.microsecond))
elif case == 4:
alert_count[3] += 1
tkinter.messagebox.showinfo("Alert", "화면 밖 응시가 감지되었습니다.")
alert_list.append("alert log[화면 밖 응시] : %s년 %s월 %s일 %s시 %s분 %s초.%s" % (now.year, now.month, now.day, now.hour, now.minute, now.second, now.microsecond))
return 0