主页
Python
Python textwrap 模块
demo_ref_module_textwrap_basic
运行 ❯
×
更改方向
保存代码
更改主题
import textwrap text = 'This is a long message from Tobias that needs to be wrapped.' wrapped = textwrap.fill(text, width=30) print(wrapped)
This is a long message from
Tobias that needs to be
wrapped.