RSS Forums RSS

Text Wrap in Terminal

Please support our Python advertiser: Programming Forums
Reply
Posts: 5
Reputation: elvenstruggle is an unknown quantity at this point 
Solved Threads: 0
elvenstruggle elvenstruggle is offline Offline
Newbie Poster

Text Wrap in Terminal

  #1  
Jan 6th, 2009
Hello, I have a text-based program (non-GUI) that would run solely inside the workspace terminal. Within this program there are hundreds of "print statements" showing really long texts.

e.g.

print "This is a really really really really really really really really really really really really really really really really really really long sentence."

Is there a way (e.g. a class) that I can use to wrap all outputted text (e.g. 70 characters long per line) around the workspace terminal? It would be perfect if I can create a class that runs in the background and wraps the texts automatically without calling it every time I use a print statement.

Thanks a lot!
AddThis Social Bookmark Button
Reply With Quote  
Posts: 770
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 138
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: Text Wrap in Terminal

  #2  
Jan 6th, 2009
Try out this guy
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote  
Posts: 521
Reputation: Gribouillis will become famous soon enough Gribouillis will become famous soon enough 
Solved Threads: 92
Gribouillis's Avatar
Gribouillis Gribouillis is offline Offline
Posting Pro

Re: Text Wrap in Terminal

  #3  
Jan 7th, 2009
Originally Posted by jlm699 View Post
Try out this guy

One of the comment of this snippet says that there is a standard module textwrap . I think it will do a better job.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Python Forum
Views: 402 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:09 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC