Python Tkinter 控件通用属性 作者:马育民 • 2023-08-21 20:51 • 阅读:10012 anchor文本对齐方式,有以下几个值: center:居中显示,默认值n:顶部对齐ne:右上对齐e:靠右侧对齐se:右下对齐s:底部对齐sw:左下对齐w:靠左对齐nw:左上对齐 width宽度,单位:一个字符的宽度 height高度,单位:一行的高度 设置背景色tk.Label(window, text='IP:', width=10,anchor='e',bg="red") 原文出处:https://malaoshi.top/show_1IX65gB45qdp.html