Exemple #1
0
def main():
    # Basic response to begin conversation
    #first perform a login
    obj = Reminder()
    mailobj = Mail()
    global counter
    global name
    global username
    log = Login()
    name, username = log.logger()
    #print("USERNAME="******" ".join(re.findall("[a-zA-Z0-9]+", str(name)))
    if name != '':
        counter = 0

    if counter == 1:  #Add name to database yet to implement
        print("Welcome to ChatterBox. What is your name?")
        name = input()
        print("Hello " + name + "\n I'm Alice")

    if counter == 0:
        print('Hello ' + name + ". Welcome back. Here are todays reminders...")
        #os.system('play --no-show-progress --null --channels 1 synth %s sine %f' % (1, 500))

        time.sleep(0.5)
        obj.RemindersToday(username)
        print("Here are your emails")

        time.sleep(2)
        mailobj.LatestMails()
        time.sleep(1)
        print("How can I help you?")
    #reception of inputs, for each input, perform processing to understand what the input requires.

    Statement = input()
    Statement = Statement.lower()
    # print(Statement)
    reply = Statement
    counter = 0
    global cond
    cond = 0

    #start giving replies
    while process(Statement) != -1:
        #preprocessing done
        Statement = input("How can I help you?\n")