FTP_client

class FTPSlient(object):
  def __init__(self,host,port):
    self.client = socket.socket()
    self.client.connect((host,port))

  def Communication(self):
    while True:
    msg = input(">>").strip()
    if not msg:continue
    self.client.send(msg.encode())
    raed_data = self.client.recv(1024)
    print(raed_data.decode())


if __name__ == "__main__":
  slient = FTPSlient("localhost",9999)
  slient.Communication()

猜你喜欢

转载自www.cnblogs.com/angle90/p/FTP_socket.html