Body_Health.py
#!/usr/bin/python
#_*_coding:utf-8_*_
#身體健康模塊
#詢問平時(shí)最常參加的運(yùn)動
def chose_sport(Chose_Sport):
Sports_Notes = open('/home/neal/Desktop/Psychological_Game/sports_notes.txt')
if Chose_Sport == 'No_Sport':
print "YOU ARE SO LAZZY !!!And here's some notes that may help ehance you body level:"
print Sports_Notes.read()
Sports_Notes.close()
else:
sport_length()
#詢問每周運(yùn)動時(shí)長的函數(shù)
def sport_length():
Sports_Notes_2 = open('/home/neal/Desktop/Psychological_Game/sports_notes_2.txt')
print "Ok,good.And how long are you sporting every week in average?"
Length = int(raw_input('> '))
print "Here's some advices which may be useful for your regular sport's training:\n",Sports_Notes_2.read()
Sports_Notes_2.close()
#執(zhí)行函數(shù)
def start():
print """which sport are you like best:
Jogging, Ball, Indoor_Fitness, Swimming, Cycling, No_Sport or Other ...
"""
Chose_Sport = raw_input('> ')
#模塊中的類中的一個(gè)函數(shù)調(diào)用本類中的另外一個(gè)函數(shù)需要在函數(shù)前加self.
chose_sport(Chose_Sport)