You are viewing a single comment's thread. Return to all comments →
import textwrap import math
def wrap(string, max_width): s = '' j = 0 lines = len(string)/max_width lu = math.ceil(lines) # print(lu) for i in range(math.ceil(lines)):
s +='{}\n'.format( string[j: j+ max_width]) j += max_width # print(textwrap.fill(l,7)) return (s)
Seems like cookies are disabled on this browser, please enable them to open this website
Text Wrap
You are viewing a single comment's thread. Return to all comments →
import textwrap import math
def wrap(string, max_width): s = '' j = 0 lines = len(string)/max_width lu = math.ceil(lines) # print(lu) for i in range(math.ceil(lines)):