def chunk_str(content, length=420):
 def chunk(c, l):
  while c:
   out = (c + ' ')[:l].rsplit(' ', 1)[0]
   c = c[len(out):].strip()
   (yield out)
 return list(chunk(content, length))

def chunk_str ( content , length = 420 ) : def chunk ( c , l ) : while c : out = ( c + ' ' ) [ : l ] . rsplit ( ' ' , 1 ) [ 0 ] c = c [ len ( out ) : ] . strip ( ) ( yield out ) return list ( chunk ( content , length ) )
chunks a string into smaller strings of given length .