本文整理汇总了Python中timer.Timer.end_of_set方法的典型用法代码示例。如果您正苦于以下问题:Python Timer.end_of_set方法的具体用法?Python Timer.end_of_set怎么用?Python Timer.end_of_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timer.Timer
的用法示例。
在下文中一共展示了Timer.end_of_set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_end_of_set_returns_false_if_not_end_of_set
# 需要导入模块: from timer import Timer [as 别名]
# 或者: from timer.Timer import end_of_set [as 别名]
def test_end_of_set_returns_false_if_not_end_of_set(self):
timer = Timer(exercises=['Push Ups', 'Burpees', 'Pull Ups'], break_time=10, time_limit=60)
# timer.current_cycle = 1
self.assertFalse (timer.end_of_set())
示例2: Timer
# 需要导入模块: from timer import Timer [as 别名]
# 或者: from timer.Timer import end_of_set [as 别名]
from timer import Timer
print """
Exercises: "push ups", "burpees", "pull ups", "up downs"
Time Limit: 60
Break Time: 10
Sets: 2
"""
timer = Timer(exercises=['Push Ups', 'Burpees', 'Pull Ups', 'Up Downs'], break_time=3, time_limit=5)
num_of_sets = 2
while (timer.set_number <= num_of_sets):
print ("\nBREAK! Up Next:")
current_exercises = timer.get_current_exercises()
print ("Person 1: " + current_exercises[0])
print ("Person 2: " + current_exercises[1])
timer.wait(timer.break_time)
print ("\n**START")
print ("\tPerson 1: " + current_exercises[0])
print ("\tPerson 2: " + current_exercises[1])
timer.wait(timer.time_limit)
if timer.end_of_set():
print ("\n\n*** END OF SET : " + str(timer.set_number) + " ***\n\n")
timer.reset()
示例3: test_end_of_set_returns_true_if_end_of_set
# 需要导入模块: from timer import Timer [as 别名]
# 或者: from timer.Timer import end_of_set [as 别名]
def test_end_of_set_returns_true_if_end_of_set(self):
timer = Timer(exercises=['Push Ups', 'Burpees', 'Pull Ups'], break_time=10, time_limit=60)
timer.current_cycle = len(timer.exercises) - 1
self.assertTrue (timer.end_of_set())