目录
首发于:
最近更新于:
分类: posts

textwrap模块

textwrap模块实现了编辑器常见的换行显示功能。默认 width=70

from textwrap import fill
wrapped = fill(output)

fill函数等于:

"\n".join(wrap(text, ...))