filename = sys.argv[1]
host = sys.argv[2]
port = int(sys.argv[3])
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((host, port))
data = open(filename).read()
send_str = 'send %d %s' % (len(data), filename)
end_str = 'end %s' % (filename,)
sock.send(send_str + '\n')
sock.send(data)
sock.send('\n' + end_str + '\n')
проблема с сокетом в питоне