在Python中将打印的文本继续到下一行

2024-05-08 13:57:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一行文字,我想把它剪下来打印到下一行,使它看起来更好。我正在使用Tkinter,并试图使一个标签使用3行而不是1行,因为文本太长,无法显示。在

label4Text.set("0.0.0.0 This subnet mask is non-routable as there is no network portion")

看起来像这样:

^{pr2}$

我希望它看起来像这样:

[0.0.0.0

This subnet mask is non-routable

There is no network portion]

如何做到这一点?在


Tags: no文本istkintermasknetwork标签this