forked from arnavjindal/python-programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHealthy Programmer.py
152 lines (116 loc) · 3.6 KB
/
Healthy Programmer.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#HEALTHY PROGRAMMER
from pygame import mixer
import time
mixer.init()
inpu_start_ = str(input("Enter \"start\" to initiate the program: "))
def getdate():
return str(time.strftime("%a, %d %b %Y %I:%M:%S %p ", time.localtime()))
done="done"
def main():
code_breaker_counter=time.perf_counter() #28800
glasses_of_water_drank = 0
water_brk_time = 1500 #1500 ~~20mis
eyes_brk_time = 1800 #1800 ~~30mis
phy_brk_time = 2700 #2700 ~~45mis
water_drank_time= time.perf_counter()
eyes_roll_time= time.perf_counter()
phy_workout_time= time.perf_counter()
while (time.perf_counter()-code_breaker_counter) <= 60 :
if (time.perf_counter()-water_drank_time) >= water_brk_time:
play_water()
if input("please enter \"Done\" if u done with drinking water: ") == done.lower():
glasses_of_water_drank += 1
mixer.music.stop()
water_drank_time = time.perf_counter()
var = "Drank the "+str(glasses_of_water_drank)+"th glass of water"
Logger("Drank Water")
print(var)
if (time.perf_counter() - eyes_roll_time) >= eyes_brk_time :
play_eyes()
if input("please enter \"Done\" if u are done rolling your eyes: ") == done.lower():
mixer.music.stop()
eyes_roll_time= time.perf_counter()
Logger("rolled the eyes")
if (time.perf_counter()-phy_workout_time) >= phy_brk_time:
play_physical()
if input("please enter \"Done\" if u have done some workout: ") == done.lower():
mixer.music.stop()
phy_workout_time = time.perf_counter()
Logger("Did Some Workout")
print('')
print("\nITS TIME TO GO HOME :)")
# def sleep_25():
# tic =time.perf_counter()
# time.sleep(25)
# tok =time.perf_counter()
# current_time=(tok-tic)
#
# def sleep_30():
# tic =time.perf_counter()
# time.sleep(25)
#
# tok =time.perf_counter()
# current_time=(tok-tic)
# def sleep_45():
# tic =time.perf_counter()
# time.sleep(45)
#
# tok =time.perf_counter()
# current_time=(tok-tic)
def Logger(log_message):
with open("LOG_Healthy_Pro.txt", "a" ) as Log:
Log.write("\n[")
Log.write(getdate())
Log.write("] ")
Log.write(log_message)
def play_water():
mixer.music.load("Water.mp3") # JUST A RANDOM SONG THAT I LOVE FOR NOW WILL ADD IT APPROPRIATE SONG LATER
mixer.music.set_volume(0.4)
mixer.music.play()
def play_eyes():
mixer.music.load("Water.mp3")
mixer.music.set_volume(0.4)
mixer.music.play()
def play_physical():
mixer.music.load("Water.mp3")
mixer.music.set_volume(0.4)
mixer.music.play()
# def list_gen():
# num3=0
# num2=0
# num1=0
# num4={0}
# list_= []
# while num1 & num2 & num3 <475:
# num1+=25
# list_.append(num1)
# num2+= 30
# num3+= 45
# list_.append(num2)
# list_.append(num3)
#
# list_.sort()
# for j in list_ :
# if j <480:
# num4.add(j)
# else:
# continue
# num5 = sorted(num4)
# num5.remove(0)
if inpu_start_ == "":
print("GET READY BY DRINKING WATER")
time.sleep(0)
print("THEN GET READY BY ROLLING YOUR EYES")
time.sleep(0)
print("NOW DO SOME STRETCHING BEFORE STARTING TO CODE")
time.sleep(0)
main()
#
# mixer.init()
# mixer.music.load("song.mp3")
# mixer.music.set_volume(0.7)
# mixer.music.play()
#
# mixer.music.unpause()
# mixer.music.stop()
# mixer.music.pause()