Skip to content

Commit 44f0616

Browse files
Add 4 new commands
1 parent 3af620e commit 44f0616

File tree

1 file changed

+54
-5
lines changed

1 file changed

+54
-5
lines changed

main.py

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# (C) 2021 - 2022
33

44
# Workout Options
5-
# Item complete - show time completed, start new time, show percentage, move to next workout
6-
# Skip
7-
# Workout finished - show total time, activities completed
85
# Stats - time, percentage complete
96
# Video - play video for that group
107

@@ -120,24 +117,31 @@ def openvideo():
120117
if select == "abs":
121118
print("You have completed: " + str((int(activity_num/len(abs_count)))) + "%")
122119
print("Please complete 2 Sets of " + str(abs_count[activity_num]) + " Reps of " + str(abs[activity_num]))
120+
complete.append(abs[activity_num])
123121
elif select == "quads":
124122
print("You have completed: " + str((int(activity_num/len(quads_count)))) + "%")
125123
print("Please complete 2 Sets of " + str(quads_count[activity_num]) + " Reps of " + str(quads[activity_num]))
124+
complete.append(quads[activity_num])
126125
elif select == "glutes":
127126
print("You have completed: " + str((int(activity_num/len(glutes_count)))) + "%")
128127
print("Please complete 2 Sets of " + str(glutes_count[activity_num]) + " Reps of " + str(glutes[activity_num]))
128+
complete.append(glutes[activity_num])
129129
elif select == "triceps":
130130
print("You have completed: " + str((int(activity_num/len(triceps_count)))) + "%")
131131
print("Please complete 2 Sets of " + str(triceps_count[activity_num]) + " Reps of " + str(triceps[activity_num]))
132+
complete.append(triceps[activity_num])
132133
elif select == "biceps":
133134
print("You have completed: " + str((int(activity_num/len(biceps_count)))) + "%")
134135
print("Please complete 2 Sets of " + str(biceps_count[activity_num]) + " Reps of " + str(biceps[activity_num]))
136+
complete.append(biceps[activity_num])
135137
elif select == "back":
136138
print("You have completed: " + str((int(activity_num/len(back_count)))) + "%")
137139
print("Please complete 2 Sets of " + str(back_count[activity_num]) + " Reps of " + str(back[activity_num]))
140+
complete.append(back[activity_num])
138141
elif select == "chest":
139142
print("You have completed: " + str((int(activity_num/len(chest_count)))) + "%")
140143
print("Please complete 2 Sets of " + str(chest_count[activity_num]) + " Reps of " + str(chest[activity_num]))
144+
complete.append(chest[activity_num])
141145
print("")
142146
activity_num = activity_num + 1
143147
run_activity = True
@@ -149,58 +153,103 @@ def openvideo():
149153
if activity_num < 6:
150154
print("You have completed: " + str((int(activity_num/len(abs_count)*100))) + "%")
151155
print("Please complete 2 Sets of " + str(abs_count[activity_num]) + " Reps of " + str(abs[activity_num]) + "\n")
156+
complete.append(abs[activity_num])
152157
else:
153158
print("You have completed all the workouts for this set!")
154159
print("Run the `end` command to finish the workout. \n")
155160
elif select == "quads":
156161
if activity_num < 6:
157162
print("You have completed: " + str((int(activity_num/len(quads_count)*100))) + "%")
158163
print("Please complete 2 Sets of " + str(quads_count[activity_num]) + " Reps of " + str(quads[activity_num]) + "\n")
164+
complete.append(quads[activity_num])
159165
else:
160166
print("You have completed all the workouts for this set!")
161167
print("Run the `end` command to finish the workout. \n")
162168
elif select == "glutes":
163169
if activity_num < 6:
164170
print("You have completed: " + str((int(activity_num/len(glutes_count)*100))) + "%")
165171
print("Please complete 2 Sets of " + str(glutes_count[activity_num]) + " Reps of " + str(glutes[activity_num]) + "\n")
172+
complete.append(glutes[activity_num])
166173
else:
167174
print("You have completed all the workouts for this set!")
168175
print("Run the `end` command to finish the workout. \n")
169176
elif select == "triceps":
170177
if activity_num < 6:
171178
print("You have completed: " + str((int(activity_num/len(triceps_count)*100))) + "%")
172179
print("Please complete 2 Sets of " + str(triceps_count[activity_num]) + " Reps of " + str(triceps[activity_num]) + "\n")
180+
complete.append(triceps[activity_num])
173181
else:
174182
print("You have completed all the workouts for this set!")
175183
print("Run the `end` command to finish the workout. \n")
176184
elif select == "biceps":
177185
if activity_num < 5:
178186
print("You have completed: " + str((int(activity_num/len(biceps_count)*100))) + "%")
179187
print("Please complete 2 Sets of " + str(biceps_count[activity_num]) + " Reps of " + str(biceps[activity_num]) + "\n")
188+
complete.append(biceps[activity_num])
180189
else:
181190
print("You have completed all the workouts for this set!")
182191
print("Run the `end` command to finish the workout. \n")
183192
elif select == "back":
184193
if activity_num < 5:
185194
print("You have completed: " + str((int(activity_num/len(back_count)*100))) + "%")
186195
print("Please complete 2 Sets of " + str(back_count[activity_num]) + " Reps of " + str(back[activity_num]) + "\n")
196+
complete.append(back[activity_num])
187197
else:
188198
print("You have completed all the workouts for this set!")
189199
print("Run the `end` command to finish the workout. \n")
190200
elif select == "chest":
191201
if activity_num < 6:
192202
print("You have completed: " + str((int(activity_num/len(chest_count)*100))) + "%")
193203
print("Please complete 2 Sets of " + str(chest_count[activity_num]) + " Reps of " + str(chest[activity_num]) + "\n")
204+
complete.append(chest[activity_num])
194205
else:
195206
print("You have completed all the workouts for this set!")
196207
print("Run the `end` command to finish the workout. \n")
197208
activity_num = activity_num + 1
198209
run_activity = True
210+
elif activity.lower() == "skip":
211+
now = datetime.now()
212+
print("You are in the " + select + " muscle group. ")
213+
print("The current time is: " + str(time.strftime("%H:%M:%S")) + ". " + str(now-start) + " has elapsed.")
214+
complete.pop(-1)
215+
print("Activity skipped! Run the `next` command to move on. \n")
216+
run_activity = True
217+
elif activity.lower() == "end":
218+
now = datetime.now()
219+
print("You have completed the " + select + " muscle group.")
220+
print("It took " + str(now-start) + " to complete this workout.")
221+
print("The following activities were completed: ")
222+
for i in range(len(complete)):
223+
print(str(i+1) + ". " + str(complete[i]))
224+
print("Congratulations! \n")
225+
run_activity = False
199226
elif activity.lower() == "quit":
200227
run_activity = False
201228
exit()
202229
break
230+
elif activity.lower() == "help":
231+
print("PyWorkout - (C) 2021-2022")
232+
print("Any of these options are available: ")
233+
print("list Lists the workout activities by muscle group.")
234+
print("start Starts the workout and displays the first workout activity.")
235+
print("next Moves to the next workout activity.")
236+
print("skip Skips the current workout activity.")
237+
print("end Completes the workout and display full workout statistics.")
238+
print("stats Shows workout statistics at any point and time.")
239+
print("video Opens the workout video assigned to each muscle group.")
240+
print("help Prints this help text.")
241+
print("quit Ends the program.")
242+
print("More documentation can be found on Github. Enjoy using the program! \n")
243+
run_activity = True
203244
else:
204245
print("Sorry that is not an option. Please see this list of options below:")
205-
print("")
206-
run_activity = True
246+
print("list Lists the workout activities by muscle group.")
247+
print("start Starts the workout and displays the first workout activity.")
248+
print("next Moves to the next workout activity.")
249+
print("skip Skips the current workout activity.")
250+
print("end Completes the workout and display full workout statistics.")
251+
print("stats Shows workout statistics at any point and time.")
252+
print("video Opens the workout video assigned to each muscle group.")
253+
print("help Prints a similar help text.")
254+
print("quit Ends the program. \n")
255+
run_activity = True

0 commit comments

Comments
 (0)