Is there a nice way splitting a (potentially) long string without splitting in words in Python?
问题 I want to make sure that I only print maximum 80 character long lines, but I have a string s that can be both shorter and longer than that. So I want to split it into lines without splitting any words. Example of long string: s = "This is a long string that is holding more than 80 characters and thus should be split into several lines. That is if everything is working properly and nicely and all that. No mishaps no typos. No bugs. But I want the code too look good too. That's the problem!" I