Python | Splitting text into lines without breaking words up

Testing testing… one two..

I’m learning python. Well, in reality I’ve been learning python for quite some time now. Since I usually live in C by day I can only use my free time to try out python.

It started with a desperate need for knowing how to make programs for the raspberry pi. Then, as time went on I have been more used to the syntax. Fortunately everything I do has been tried before so I can look it up on the net.

Anyway, this is just a real quick one. If you ever find yourself having to split a sentence into smaller chunks of text but preserving the readability of the string you really want to split on the spaces. How to do that?

Here’s how:

Not really that advanced after all!

Leave a Reply