How do I change the text size in a label widget, python tkinter [duplicate]

梦想的初衷 提交于 2019-12-09 08:28:25

问题


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:


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


来源:https://stackoverflow.com/questions/30685308/how-do-i-change-the-text-size-in-a-label-widget-python-tkinter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!