Tkinter之Label

简介:

最近要弄弄以前想弄的东东了,

所以图形界面不可少,,TKinter, 就用它了,

简单,满足要求。

复制代码
#coding: utf8
from Tkinter import *

def tklabel(event):
    s = Label(root, text="IloveXin")
    s.pack()


root = Tk()
root.wm_title("hello")
labelA = Label(root, text="learn tkinter", background="green")
labelB = Label(root, text="learn tkinter", background="red")
labelC = Label(root, text="learn tkinter", background="blue")
b1 = Button(root, text="click", command=tklabel)
b2 = Button(root, text="click")
b2['width'] = 30
b2['height'] = 6
b2['background'] = 'pink'
b2.bind("<Button-1>", tklabel)
b1.pack()
b2.pack()
labelA.pack()
labelB.pack()
labelC.pack()




root.mainloop()
复制代码

目录
相关文章
|
4月前
|
Python
tkinter之panedwindow
tkinter之panedwindow
42 0
|
4月前
|
Python
tkinter之grid布局
tkinter之grid布局
24 1
|
4月前
|
小程序 Python
Tkinter 中的标签(Label)
Tkinter 中的标签(Label)组件是一种用于显示文本或图像的控件。它可以通过 tk.Label() 函数创建,常用的属性包括: - text:设置标签显示的文本内容。
33 1
|
4月前
|
Python
tkinter之Radiobutton
tkinter之Radiobutton
26 1
|
4月前
|
Python
tkinter之place
tkinter之place
28 0
|
4月前
|
Python
tkinter之frame
tkinter之frame
21 1
|
4月前
|
Python
tkinter之ListBox示例
tkinter之ListBox示例
28 1
|
4月前
|
Python
tkinter之Button按钮
tkinter之Button按钮
19 1
|
4月前
label控件
label控件
24 1
|
算法 Python
Tkinter的Label与Button
Tkinter是Python的一个内置包,主要用于简单的界面设计,使用起来非常方便。
64 0
Tkinter的Label与Button