Skip to content

Instantly share code, notes, and snippets.

@SeavantUUz
Created August 17, 2014 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeavantUUz/3e6f1494ff8a1e2b528e to your computer and use it in GitHub Desktop.
Save SeavantUUz/3e6f1494ff8a1e2b528e to your computer and use it in GitHub Desktop.
def line_resize(lines, width):
count = len(lines)
index = 0
while index < count:
line = lines[index]
line_lenth = len(line)
if line_lenth > width:
s_width = 0
while s_width < line_lenth:
yield line[s_width:s_width+width]
s_width += width
index += 1
else:
yield line
index += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment