def get_poetry(address):
 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 sock.connect(address)
 poem = ''
 while True:
  data = sock.recv(1024)
  if (not data):
   sock.close()
   break
  poem += data
 return poem

def get_poetry ( address ) : sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) sock . connect ( address ) poem = '' while True : data = sock . recv ( 1024 ) if ( not data ) : sock . close ( ) break poem += data return poem
download a piece of poetry from the given address .