且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过 Tkinter 更改标签上文本的大小

更新时间:2023-10-03 17:53:40

font 参数采用最多 3 个成员的元组 (family, size, style) 你可以省略家庭并像这样简单地改变大小:

The font argument takes a tuple with up to 3 members (family, size, style) You can omit the family and simply change the size like this:

label = Label(root, text="PASS", bg="green", fg="black", font=(None, 15), height=50, width=50)

heightwidth 参数改变了标签本身的大小,它们不影响字体.

The height and width arguments are changing the size of the label itself, they do not affect the font.