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!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.