def print_restricted(strings, template, spacing, color=None):
"""
Prints a list of strings spaced out on the screen according to an
accompanying template list. Output can be colored via cprint and the color
variable.
"""
string_list = []
for each in zip(strings, template, spacing):
segment = each[1].format(each[0][:each[2]], width=each[2])
string_list.append(segment)
for each in string_list:
if color == None:
print(each, end='')
else:
cprint(each, color, end='')
评论列表
文章目录