How do I change the text size in a label widget, p

2020-06-07 04:07发布

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')

and

label_one.config(fontsize='50')

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

1条回答
疯言疯语
2楼-- · 2020-06-07 04:50

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))
查看更多
登录 后发表回答