如何在标签窗口小部件python tkinter中更改文本大小

问题描述:

在使用Tkinter的python 3.4中,如何更改标签小部件中的文本大小?

In python 3.4 using Tkinter, how do I change the text size in a label widget?

到目前为止,我已经尝试过

So far I have tried

label_one = Label(root, text = 'Hello', size = '50')

label_one.config(fontsize='50')

但是我不确定从哪里开始,找不到任何说明如何做的东西.

But I am not sure where to start and I can't find anything saying how to do it.

在创建标签时,尝试将width=200作为附加参数传递.

Try passing width=200 as additional paramater when creating the Label.

这应该可以创建具有指定宽度的标签.

This should work in creating label with specified width.

如果您以后想要更改,可以使用:

If you want to change it later, you can use:

label.config(width=200)

要更改字体本身的大小,可以尝试:

As you want to change the size of font itself you can try:

label.config(font=("Courier", 44))