天下程序员首页cx06.com
管理 |  登录 |  注册
组件对象的属性options的3种方式
更新于:2024-07-29
如下的写法中:

label02=Label(root,text="天下程序员02",width=15,height=2,
              bg="black",fg="white",font=("黑体",30))

label02就是一个组件对象

里面的text就是一个属性options

3种写法都可以实现:
  • 1、直接定义:Label(root,text="天下程序员02",width=15,height=2,
              bg="black",fg="white",font=("黑体",30))
  • 2、字典方式定义: label03['fg']="white"
  • 3、用config方式定义:label03.config(bg="white")
天下程序员 www.cx06.com 程序员的网上家园!
作者微信:13126507001