本文整理汇总了Python中calculator.Calculator.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Calculator.stop方法的具体用法?Python Calculator.stop怎么用?Python Calculator.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calculator.Calculator
的用法示例。
在下文中一共展示了Calculator.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from calculator import Calculator [as 别名]
# 或者: from calculator.Calculator import stop [as 别名]
#.........这里部分代码省略.........
return None
# update background image from a feature
def update_background_image(self, image):
if self.slideshow and self.slideshow.background_image.size > 0:
return self.slideshow.background_image
elif self.television and self.television.background_image.size > 0:
return self.television.background_image
else:
return image
# handle features
def handle(self, rocky_robot, sporty_robot, image):
self._handle_acting(rocky_robot, sporty_robot)
self._handle_browser(rocky_robot, sporty_robot)
self._handle_calculator(rocky_robot, sporty_robot)
self._handle_hand_gesture(rocky_robot, sporty_robot, image)
self._handle_happy_colour(rocky_robot, image)
self._handle_mixing_desk(rocky_robot)
self._handle_optical_character_recognition(rocky_robot, sporty_robot, image)
self._handle_phrase_translation(sporty_robot)
self._handle_play_your_cards_right(sporty_robot)
self._handle_slideshow(rocky_robot, sporty_robot, image)
self._handle_television(rocky_robot, sporty_robot, image)
self._handle_weather(rocky_robot, sporty_robot)
# handle acting
def _handle_acting(self, rocky_robot, sporty_robot):
if not self.acting: return
if rocky_robot.is_facing or sporty_robot.is_facing:
self.acting.start()
else:
self.acting.stop()
# handle browser
def _handle_browser(self, rocky_robot, sporty_robot):
if not self.browser: return
if rocky_robot.is_facing:
self.browser.start(ROCK)
elif sporty_robot.is_facing:
self.browser.start(SPORT)
else:
self.browser.stop()
# handle calculator
def _handle_calculator(self, rocky_robot, sporty_robot):
if not self.calculator: return
if rocky_robot.is_facing or sporty_robot.is_facing:
self.calculator.start()
else:
self.calculator.stop()
# handle hand gesture
def _handle_hand_gesture(self, rocky_robot, sporty_robot, image):
if not self.hand_gesture: return
if rocky_robot.is_facing or sporty_robot.is_facing:
self.hand_gesture.start(image)
else:
self.hand_gesture.stop()
# handle happy colour
def _handle_happy_colour(self, rocky_robot, image):