python核心编程-GUI程序之标签,按钮,进度条

来源:互联网 发布:淘宝office2016激活码 编辑:程序博客网 时间:2024/06/03 12:42
#!/usr/bin/env python# -*- coding: UTF-8 -*- from Tkinter import *def resize(ev=None):    label.config(font='Helvetica -%d bold' % scale.get())top = Tk()top.geometry()label = Label(top, text = 'hello world!', font = 'Helvetica -12 bold')label.pack(fill=Y,expand=1)scale = Scale(top, from_=10, to=40, orient=HORIZONTAL, command=resize)scale.set(12)scale.pack(fill=X, expand=1)quit = Button(top, text="QUIT", command=top.quit, activeforeground='white', activebackground='red')quit.pack()mainloop()

输出
这里写图片描述

0 0
原创粉丝点击