find space position to cut using str.rindex(), then cut inside try... except block solution in Clear category for Cut Sentence by ann3leo
def cut_sentence(line, length):
if len(line) <= length:
cut_space = line.rindex(' ', 0, length+1)
return line[:cut_space] + '...'
Nov. 7, 2020