Question: from socket import * serverPort = 9999 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) serverSocket.listen(2) print ('The server,',serverPort, ', is ready to receive sentence from client') while 1:
from socket import * serverPort = 9999 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) serverSocket.listen(2) print ('The server,',serverPort, ', is ready to receive sentence from client') while 1: connectionSocket, addr = serverSocket.accept() choice = connectionSocket.recv(1024) sentence = connectionSocket.recv(1024) if choice == 1: capitalized1stLetter = sentence.title()# leaves the first letter of the word in capitals connectionSocket.send(capitalizedSentence) elif choice == 2: capitalizedSentence = sentence.upper()# leaves the entire message in Capitals connectionSocket.send(capitalized1stLetter) elif choice == 3: lowercaseSentence = sentence.lower()# leaves the entire message in lowercase connectionSocket.send(lowercaseSentence) connectionSocket.close()
This is a program is python. The program name is TCP Server. i just need to change it up. please edit it or put comments in it on whatever you feel like doing in it. but just change it up and make sure it runs and let me know which pyhotn terminal(3.2 or 2.0) did you use.
Please do this ASAP, I need it in couple of hours. Thank you in advance and I promise to give you a thumbs up!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
