Created
August 17, 2014 08:23
-
-
Save SeavantUUz/3e6f1494ff8a1e2b528e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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