I need to sort of word-wrap a long sentence.

+1 Mel Addison · December 7, 2014
OK, I hook up to a program to download Thoughts for Today. Some sentences are very very long. I need to have them wrap so I can see the contents without scrolling this long horizontal line.

Anybody have any suggestions?

Thanks in Advance!

Mel

Post a Reply

Replies

Oldest  Newest  Rating
0 Mel Addison · December 10, 2014
Well, thanks for  trying to help.

Mel
0 Vaggelis Theodoridis · December 8, 2014
Np Mel, It's not you, its my english.
Still i cant understand sorry. When you say screen you mean in the cmd? idle? Or maybe you mean in your text editor?
Maybe textwrap module can help?  https://docs.python.org/2/library/textwrap.html
0 Mel Addison · December 7, 2014
I am not doing well at communicating correctly. 

1.  When I get a line of text it comes into the buffer.
      Then . . ..
2.  Instead of wrapping the sentence to were I can see it like this, It goes off of the screen like this:now is the time for all good men to come to the aid of their country.  The lines are too long. I need for it to wrap it by inserting a line feed when it needs to go to the next line. Most word processors do that.

I hope you understand. And, of course Thank  You for the reply.
0 Vaggelis Theodoridis · December 7, 2014
You mean split strings inside your code?
a = "some_text_here \
without new lines \
cause i escaped them"
  • 1

Python

107,080 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator