本文整理汇总了Python中view.View.read_pa方法的典型用法代码示例。如果您正苦于以下问题:Python View.read_pa方法的具体用法?Python View.read_pa怎么用?Python View.read_pa使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.read_pa方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import read_pa [as 别名]
class Controller:
def __init__(self):
self.view = View()
def menu(self):
while True:
point = self.view
if point == 1:
self._calculate()
elif point == 2:
serialize.load()
elif point == 3:
data = self.view.change_serialization_file()
serialize.change_config(data[0], data[1])
elif point == 4:
break
def _calculate(self):
gender = self.view.read_gender()
weight = self.view.read_weight()
height = self.view.read_height()
age = self.view.read_age()
pa = self.view.read_pa()
model = Model(gender, weight, height, age, pa)
calories = model.calculate_calories()
self.view.get_info()
data = (gender, weight, height, age, pa, calories)
raw_input()
if self.view.is_dump():
serialize.dump(data)