Python:Tkinter之Radiobutton
来源:互联网 发布:网络作家怎样赚钱 编辑:程序博客网 时间:2024/05/16 07:01
最近才刚开始学pythonGUI,虽然用Python做GUI肯定不是明智之举,但为了学习,还是了解了解,今天先来看看 Radiobutton,没什么可说的,直接贴代码。
from Tkinter import * def sel(): selection = "You selected the option " + str(var.get()) label.config(text = selection) root = Tk() root.geometry('350x150') var = IntVar() R1 = Radiobutton(root, text="Option 1", variable=var, value=1, command=sel) R1.pack( anchor = W ) R2 = Radiobutton(root, text="Option 2", variable=var, value=2, command=sel) R2.pack( anchor = W ) R3 = Radiobutton(root, text="Option 3", variable=var, value=3, command=sel) R3.pack( anchor = W) label = Label(root) label.pack() root.mainloop()
最后的效果:
0 0
- Python:Tkinter之Radiobutton
- Python:Tkinter之Radiobutton
- Python--Tkinter之 Button()/Checkbutton()/Radiobutton()
- Python Tkinter Radiobutton控件
- Tkinter之Radiobutton篇
- Tkinter教程之Radiobutton篇
- Tkinter教程之Radiobutton篇
- Tkinter学习笔记之Radiobutton选择按钮
- Python之Tkinter:动作
- Python之Tkinter:动作
- Python--Tkinter之Listbox()
- Python---tkinter之Text()
- python Tkinter之Button
- python开发之tkinter
- Python学习之Tkinter
- Python GUI 之 TKinter(一)
- python开发之Tkinter可视化
- python之Tkinter控件学习
- css的权重(二)
- POJ3041Asteroids(二分图最大匹配)
- 常见线程池和启动定时器线程池-笔记整理7
- C++第4次作业
- Linux内核分析课程-- 理解进程调度时机跟踪分析进程调度与进程切换的过程
- Python:Tkinter之Radiobutton
- httpclient
- Water problem HDU
- ob缓存
- nginx 配置手机设备和pc设备请求不同的后台
- 【神经网络与深度学习】【计算机视觉】SPPNet-引入空间金字塔池化改进RCNN
- 关于find命令的一个奇葩问题, 其实不奇葩------不过是软链在捣鬼而已
- Python 3.x中导入urllib出现AttributeError: module 'urllib' has no attribute 'urlopen'
- Water problem HDU