Exemplo n.º 1
0
def start_chat()   :
        
        show_menu=True

        while show_menu:
            print "1.Add Status  \n 2.Add Friend\n 3. Send Secret Message\n 4. Read Secret Message\n 5.Close Application.\n"
            menu_choice=raw_input("What do You want to do: ")

            if menu_choice=='1':
                # update the status
                print "You have chosen to update a status"
                spy.current_status_message = spy_status.add_status(spy.current_status_message)
            elif menu_choice =='2':
                # Add Friend
                print "You have chosen to add a Friend"
                spy_friend.add_friend()
            elif menu_choice == '3':
                # Send a secret message
                print "\n You Have Chosen to send a secret message to a friend"
                spy_friend.send_message()
            elif menu_choice == '4':
                # Read a secret message
                print "\n You Have Chosen to read a secret message of a friend"
                spy_friend.read_message()
            elif menu_choice=='5':
                show_menu=False
            else:
                print "\nIncorrect Choice"
Exemplo n.º 2
0
def start_chat():
    show_menu = True
    while show_menu:
        print("\nYou can select from the operations")
        print(
            "1. Add Friend\n 2. Add Status\n 3. Send Secret Message\n 4. Read Secret Message\n 5. Close application"
        )
        menu_choice = int(input("What do you want to do: "))

        if menu_choice == 1:
            print("\nYou have chosen to add a friend")
            spy_friend.add_friend()
        elif menu_choice == 2:
            print("\nYou have chosen to add a status")
            spy.current_status_message = spy_status.add_status(
                spy.current_status_message)
        elif menu_choice == 3:
            print("\nYou have chosen to send message")
            spy_friend.send_message()
        elif menu_choice == 4:
            print("\nYou have chosen to read message")
            spy_friend.read_message()
            #print(current_chat)
        elif menu_choice == 5:
            print("\nYou have chosen to close the application")
            show_menu = False
        else:
            print("\nIncorrect choice")
Exemplo n.º 3
0
def start_chat(spy_name, spy_salutation, spy_age, spy_rating):
    current_status_message = None
    show_menu = True
    while show_menu == True:
        Menu_choice = raw_input(
            "1.Add a status update\n2.Add a friend\n3.Send secret message\n4.Read secret message\n5.Exit Application"
        )
        if Menu_choice == '1':
            #update the status
            print("you have choosn to add a status")
            current_status_message = spy_status.add_status(
                current_status_message)
        elif Menu_choice == '2':
            print("you have to choosen to add a friend\n")
            spy_friend.add_friend()
        elif Menu_choice == '3':
            print("you have choosen to Send message\n")
            spy_friend.send_message()
        elif Menu_choice == '4':
            print("you have choosen to Read message\n")
            spy_friend.read_message()
        elif Menu_choice == '5':
            print("you have choosen to close the Application\n")
            show_menu = False
        else:
            print("incorrect choice\n")
def start_chat():
    show_menu = True
    while show_menu == True:
        menu_choice = raw_input(
            "1. Add a status update\n2. Add Friend\n3. Send message to a friend\n4. Read secret messages of a friend\n5. Read chat history of a friend\n6. Exit Application"
        )
        if menu_choice == '1':
            #update the status
            print "\nYou have chosen to add a status"
            spy.current_status_message = spy_status.add_status(
                spy.current_status_message)
        elif menu_choice == '2':
            print "\nYou have chosen to add a friend"
            spy_friend.add_friend()
        elif menu_choice == '3':
            print "\nYou have chosen to send a secret message to a friend"
            spy_friend.send_message()
        elif menu_choice == '4':
            print "\nYou have chosen to read a secret message of a friend"
            spy_friend.read_message()
        elif menu_choice == '5':
            print "\nYou have chosen to read chat history of a friend"
            spy_friend.read_chat_history()
        elif menu_choice == '6':
            print "\nYou have chosen to close the Application"
            show_menu = False
        else:
            print "\nInCorrect Choice"
Exemplo n.º 5
0
def start_chat():
    current_status_message=None
    friend_count=0

    #displaying menu of spy_chat
    while True:
        print('\nMENU\n1. Add Status\n2. Add Friend\n3. Send Message\n4. Read Message\n5. Close\n')

        #input choice
        menu_choice=int(raw_input('Select Options from Menu\n'))
        if menu_choice==1:
            spy.current_status_message=AS.add_status(spy.current_status_message)
            print('UPDATED STATUS MESSAGE : %s\n'%(spy.current_status_message))
        elif menu_choice==2:
            friend_count=SF.add_friend()
            print('No. Of Friends You have : %d\n'%(friend_count))
        elif menu_choice==3:
            SF.send_message()
        elif menu_choice==4:
            SF.read_message()
        elif menu_choice==5:
            break
        else:
            print('\nPlease enter a valid choice\n')
Exemplo n.º 6
0
def start_chat():
	show_menu = True
	while show_menu:
		print("\nYou can choose from the below Operations.")
		print("1. Add Friend\n2. Add Status\n3. Send a Message\n4. Read a Message\n5. Close application")
		menu_choice = int(input("What would your choice be: "))

		if menu_choice == 1:
			print("\nYou have chosen to add a Friend.")
			spy_friend.add_friend()
		elif menu_choice == 2:
			print("\nYou have chosen to update your Status.")
			spy.current_status_message = spy_status.add_status(spy.current_status_message)
		elif menu_choice == 3:
			print("\nYou have chosen to send a Message to a Friend.")
			spy_friend.send_message()
		elif menu_choice == 4:
			print("\nYou have chosen to read a Message from a Friend.")
			spy_friend.read_message()
		elif menu_choice == 5:
			print("\nYou have chosen to terminate the application.")
			show_menu = False
		else:
			print("\nInvalid choice entered.")