Sending files between client - server through TCP socket in python?
问题 I'm trying to send and receive files through a TCP socket. When user types put abc.txt , abc.txt should be copied to the server. When user types get def.txt , def.txt should be downloaded to the user computer. (Actually I have to implement 2 more methods - ls to list all files in the client directory and lls to list all files in the server, but I haven't done it yet.) Here's the code Server import socket import sys HOST = 'localhost' PORT = 3820 socket = socket.socket(socket.AF_INET, socket