def wraplines (linessize=defaultsize)"samebut concat as one long linetext 'join(lineslines wraptext (textreturn [(line '\ 'for line in linesput them back more uniform across lines but loses original structure put together as line wrap on delimiters put newlines on ends ##############################################################################self-test ##############################################################################if __name__ ='__main__'lines ['spam ham 'spam,ni 'spam ham 'spam,ni 'spam ham ni '''spam'* ''spam ham eggs'sep '- print('all'sepfor line in linesprint(repr(line)print('simple'sepfor line in wraplinessimple(lines)print(repr(line)print('smart'sepfor line in wraplinessmart(lines)print(repr(line)print('single 'sepfor line in wraplinessimple([lines[ ]] )print(repr(line)print('single 'sepfor line in wraplinessmart([lines[ ]] )print(repr(line)print('combined text'sepfor line in wraplines (lines)print(repr(line)print('combined lines'sepprint(wraptext ('\njoin(lines))assert 'join(lines='join(wraplinessimple(lines )assert 'join(lines='join(wraplinessmart(lines )print(len('join(lines))end='print(len('join(wraplinessimple(lines)))end='print(len('join(wraplinessmart(lines)))end='print(len('join(wraplinessmart(lines )))end='input('press enter'pause if clicked html textextracting text from html (prototypepreviewexample - lists the code of the simple-minded html parser that pymailgui uses to extract plain text from mails whose main (or onlytext part is in html form this extracted text is used both for display and for the initial text in replies and forwards the pymailgui client