Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import socket
def Main():
#connection to ChatBot
host = '127.0.0.1'
port = 50036
thisSocket = socket.socket()
thisSocket.connect((host,port))
#Reading first message to ChatBot
message = input(" Message to ChatBot: ")
#Continue conversation with ChatBot until end is types
while message != "end":
#send message to Chatbot
thisSocket.send(message.encode())
#Receive Message from ChatBot
RMess = thisSocket.recv(1024).decode()
#Print message from ChatBot
print('Message Received from ChatBot: '+RMess)
#Get user message to ChatBot
message = input(" Foodie: ")
#Close Socket
thisSocket.close()
#Display conversation is over
print("Conversation between user and ChatBot Ended")
#Check if running directly from this file
if __name__ == '__main__':
Main()