Question: Three lines of code, lines numbered 13, 18, and 23 are missing in the lab3.pdf program and are marked in green as comments. Complete the

Three lines of code, lines numbered 13, 18, and 23 are missing in the lab3.pdf program and are marked in green as comments. Complete the code and verify that it executes.

Use the following command to compile

c\>python lab3.p

Send a screenshot of the set of commands used to execute your program, and a screenshot of the output.

Three lines of code, lines numbered 13, 18, and 23 are missing

# Import socket module from socket import * serverSocket = socket (AF_INET, SOCK_STREAM) server Port = 6789 serverSocket.bind(("", serversort)) serverSocket.listen (1) # Server should be up and running and listening to the incoming connections while True : print ('Ready to serve...') # Set up a new connection from the client # fillin 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 # If an exception occurs during the execution of try clause try: # Receives the request message from the client # fillin filename = message.split() [1] f = open(filename[1:]) outputdata f.read() # Send the HTTP response header line to the connection socket # fillin = for i in range (0, len (outputdata)): connectionsocket.send(outputdata[i]) connection socket.send(" ") connectionSocket.close() except IOError: connectionsocket.send("HTTP/1.1 404 Not Found ") connectionsocket.send("

404 Not Found

") connection socket.close() 34 35 36 37 38 serverSocket.close()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!