-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
104 lines (70 loc) · 3.56 KB
/
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
### Author : Manjubashini ###
import tkinter
import math
from math import log
from datetime import datetime,timedelta
window=tkinter.Tk()
Title=window.title("FORENSIC TIME OF DEATH CALCULATOR")
window["bg"]="pink"
Body_F=tkinter.StringVar()
Time_Death=tkinter.StringVar()
Locality_F=tkinter.StringVar()
Time_Diff=tkinter.StringVar()
After_BT=tkinter.StringVar()
def TIMEOFDEATH():
Body_Temperature= float(Body_F.get())
Time_of_Death=Time_Death.get().split(':')
Locality_Temperature= float(Locality_F.get())
Time_Difference= int(Time_Diff.get())
After_Body_Temperature= float(After_BT.get())
#print(Body_Temperature)
#print(Time_of_Death)
#print(Locality_Temperature)
#print(Time_Difference)
#print(After_Body_Temperature)
Normal_Temp=98.6
c=(Body_Temperature - Locality_Temperature)
e=((After_Body_Temperature - Locality_Temperature)/c)
upp=((Normal_Temp - Locality_Temperature)/c)
#print(e)
De= math.log(e)
Ne=Time_Difference*(log(upp))
Hour=(Ne/De)
frac,whole=math.modf(Hour)
minute=abs(int(60/100*(frac*100)))
if(Time_of_Death[2]=='PM'):
if(int(Time_of_Death[0])<12):
Time_of_Death[0]=int(Time_of_Death[0])+12
if(Hour<0):
d=datetime(2022,4,11,int(Time_of_Death[0]),int(Time_of_Death[1])) + timedelta(hours=int(Hour),minutes=minute)#frt , nlchr
else:
d=datetime(2022,4,11,int(Time_of_Death[0]),int(Time_of_Death[1])) - timedelta(hours=int(Hour),minutes=minute)
ans=d.strftime("%I:%M%p")
Answer=tkinter.Label(window,text="TIMEOFDEATH IS : "+ans,font=("Calibre",20,"bold"),fg=("purple"),bg=("pink"))
Answer.place(x=500,y=650)
label=tkinter.Label(window,text="FORENSIC TIME OF DEATH CALCULATOR",font=("calibre",20,"bold"),bg=("pink"))
Body_Temp=tkinter.Label(window,text="BODY TEMPERATURE-FIRST READING",font=("Calibre",10,"bold"),fg=("black"),bg=("pink"))
Body_Temp_entry=tkinter.Entry(window,textvariable=Body_F,font=("Calibre",10,"bold"),bg=("white"))#cr entry for name input
Time_death=tkinter.Label(window,text="TIME OF FIRST READING",font=("calibre",10,"bold"),fg=("black"),bg=("pink"))
Time_death_entry=tkinter.Entry(window,textvariable=Time_Death,font=("calibre",10,"bold"))#cr entry for pass input
Locality_Temp=tkinter.Label(window,text="TEMPERATURE OF THE LOCALITY",font=("calibre",10,"bold"),fg=("black"),bg=("pink"))
Locality_Temp_entry=tkinter.Entry(window,textvariable=Locality_F,font=("calibre",10,"bold"))
Time_Taken=tkinter.Label(window,text="TIME BETWEEN FIRST AND SECOND READING",font=("calibre",10,"bold"),fg=("black"),bg=("pink"))
Time_Taken_entry=tkinter.Entry(window,textvariable=Time_Diff,font=("calibre",10,"bold"))
Body_Temp2=tkinter.Label(window,text="BODY TEMPERATURE-SECOND READING",font=("calibre",10,"bold"),fg=("black"),bg=("pink"))
Body_Temp2_entry=tkinter.Entry(window,textvariable=After_BT,font=("calibre",10,"bold"))
sub_btn=tkinter.Button(window,text="TIMEOFDEATH",font=("calibre",15,"bold"),fg=("grey"),bg=("sky blue"),command=TIMEOFDEATH)
#grid logic
label.place(x=380,y=20)
Body_Temp.place(x=400,y=100)
Body_Temp_entry.place(x=800,y=100)
Time_death.place(x=400,y=200)
Time_death_entry.place(x=800,y=200)
Locality_Temp.place(x=400,y=300)
Locality_Temp_entry.place(x=800,y=300)
Time_Taken.place(x=400,y=400)
Time_Taken_entry.place(x=800,y=400)
Body_Temp2.place(x=400,y=500)
Body_Temp2_entry.place(x=800,y=500)
sub_btn.place(x=600,y=580)
window.mainloop()