print('Habits Copyright © 2017
Version: 0.1
Author: Christopher Chen
')
import time
import winsound
import random
print('Welcome to Habits! Here, Habits will remind you to take breaks after long work
periods and help you develop good habits.')
ListOfActivities = ['Drink some water, and take a restroom break.', 'Do 2 sets of 10 pushups!', 'Stand up, walk outside, and walk around for a while.', 'Massage you eyes, and meditate.']
start = str(input('Please get ready to choose a ringtone. Also, adjust your speakers to a tolerable
rate, so the ringtone won't be too loud.
Listen carefully in order to hear. When you are ready, just press ENTER.
'))
for ringtone in range(1,6):
print('Here is ringtone ' + str(ringtone) + ':')
ringtone = 'sms-alert-' + str(ringtone) + '-daniel_simon.wav'
winsound.PlaySound(ringtone, winsound.MB_OK)
time.sleep(1)
if ringtone != 5:
hear = input('Enter R if you want to replay the sound, if you do not want to replay the
sound, then just enter nothing.
')
while hear == 'R':
winsound.PlaySound(ringtone, winsound.MB_OK)
hear = input('Enter R if you want to replay the sound, if you do not want to replay the
sound, then just enter nothing.
')
ringtone = str(input('Please choose one of the ringtones. Enter either 1, 2, 3, 4, or 5.
'))
while ringtone != '1' and ringtone != '2' and ringtone != '3' and ringtone != '4' and ringtone != '5':
ringtone = str(input('That input is not in the choices.
Please choose one of the ringtones. Enter either 1, 2, 3, 4, or 5.
'))
int(ringtone)
ringtone = 'sms-alert-' + str(ringtone) + '-daniel_simon.wav'
time_split = input('Which of the following time plans do you want?
A) 30 minutes of work & 30 minutes of rest
B) 35 minutes of work & 25 minutes of rest
C) 40 minutes of work & 20 minutes of rest
D) 45 minutes of work & 15 minutes of rest
E) 50 minutes of work & 10 minutes of rest.
Please choose A, B, C, D, or E.
')
while time_split.upper() != 'A' and time_split.upper() != 'B' and time_split.upper() != 'C' and time_split.upper() != 'D' and time_split.upper() != 'E':
time_split = input('That input is not valid.
Which of the following time plans do you want?
A) 30 minutes of work & 30 minutes of rest
B) 35 minutes of work & 25 minutes of rest
C) 40 minutes of work & 20 minutes of rest
D) 45 minutes of work & 15 minutes of rest
E) 50 minutes of work & 10 minutes of rest.
Please choose A, B, C, D, or E.
')
if time_split.upper() == 'A':
time_time = 30
if time_split.upper() == 'B':
time_time = 35
if time_split.upper() == 'C':
time_time = 40
if time_split.upper() == 'D':
time_time = 45
if time_split.upper() == 'E':
time_time = 50
#print(time_time)
while True:
print('Time to Work!! ' + time.asctime().split()[3])
time.sleep(60*time_time)
activity = random.randrange(len(ListOfActivities))
winsound.PlaySound(ringtone, winsound.MB_OK)
print(ListOfActivities[activity] + ' ' + time.asctime().split()[3])
time.sleep(60*(60 - time_time))
winsound.PlaySound(ringtone, winsound.MB_OK)
Healthy Sitting Habits Program