python health & love game(2)

Love.py

#!/usr/bin/python
#_*_coding:utf-8_*_
#恋爱模块

Inf = ''
Friend = ''

#是否有对象
def friend_or():
    global Inf,Friend
    print "Do you have BF or GF now ? Y & N"
    Friend = raw_input('> ')
    Inf += Friend+'\t'
    #如何简洁的追加\t? 


#记录性别数据
def sex():
    global Inf
    print "You are boy or girl ?"
    Inf += raw_input('> ')+'\t'

#处对象多长时间
def friend_time():
    global Inf
    print "How long have you fill in love with her/him ?"
    Inf += raw_input('> ')+'\t'
        
#影响感情的关键因素
def emotion_element():
    global Inf
    print "What is the most important factor in maintaining sentiment? "
    Inf += raw_input('> ')+'\t'
        
#对未来对象的期待
def request():
    global Inf
    print "what's the request of your future BF or GF ?"
    Inf += raw_input('> ')+'\t'
        
#执行函数
def start():
    global Inf
    Love_Inf = open('/home/neal/Desktop/Psychological_Game/love_infor.txt','a')
    friend_or()
        
    if Friend == 'Y':
        sex()
        friend_time()
        emotion_element()
    elif Friend == 'N':
        request()
            
    Love_Inf.write(Inf)
    Love_Inf.write('\n')
    Love_Inf.close()

你可能感兴趣的:(python health & love game(2))