def fill(self, string, indent=' ', max_width=72):
"""Wrap string so it fits within at most ``max_width`` columns.
If the terminal is less than ``max_width`` columns, the string
will be filled into that smaller width instead.
"""
if not isinstance(string, str):
string = ' '.join(string)
width = min(max_width, get_terminal_size().columns)
return textwrap.fill(
string, width=width, initial_indent=indent, subsequent_indent=indent,
break_on_hyphens=False)
评论列表
文章目录