Answer to Question #274788 in Python for Karabo

Question #274788

n distributed systems, most of the time the processing is based on client/server computing- the

client will request a service from the server and the server will process the service-request and

then send a reply to the client. The communication takes place over wired or wireless computer

networks.

In this lab project:You are a given a CSV file, and you should copy the file into some directory on

the server.

Using Python- you will import the CSV file and analyse the data frames (i.e. data structured as

columns and rows). To be able to do this - you need to install “pandas” on Python.

1. Write both TCP client and TCP server in Python version 3.8 or above.

2. Test the network connectivity between TCP client and TCP server.

3. Import the CSV file into the TCP server.

4. Find the number of rows and columns of the data set, and display the results on the TCP client

machine.

5. Output the 2

nd row on the TCP client machine.



1
Expert's answer
2021-12-03T00:37:06-0500
from socket import *
import sys
import json




serverName = ""
serverPort = 6100




clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName, serverPort))


sample_data = {
	"Aparna" : 1,
	"Pooja" : 2,
	"Shreya" : 3,
	"Tanishq" : 4
}


serialized_data = json.dumps(sample_data) #data serialized


# clientSocket.send(str.encode(sample_data))
clientSocket.send(str.encode(serialized_data))


response_data = clientSocket.recv(1024)
print("Response data from server : ", response_data.decode())


clientSocket.close()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS