Python3 tkinter基础 Radiobutton indicatoron 改变按钮的外观 圆形/方形
- Python : 3.7.0
- OS : Ubuntu 18.04.1 LTS
- IDE : PyCharm 2018.2.4
- Conda : 4.5.11
- typesetting : Markdown
code
"""
@Author : 行初心
@Date : 18-10-1
@Blog : www.cnblogs.com/xingchuxin
@Gitee : gitee.com/zhichengjiu
"""
from tkinter import *
def main():
root = Tk()
v = IntVar()
v.set(3) # 如果1,那么儒家被默认选中
# 如果2,那么道家被默认选中
# 如果3,那么佛家被默认选中
rb1 = Radiobutton(root, text='儒家', variable=v, value=1, indicatoron=False)
rb1.pack()
rb2 = Radiobutton(root, text='道家', variable=v, value=2, indicatoron=False)
rb2.pack()
rb3 = Radiobutton(root, text='佛家', variable=v, value=3, indicatoron=False)
rb3.pack()
rb4 = Radiobutton(root, text='墨家', variable=v, value=4, indicatoron=True)
rb4.pack()
rb5 = Radiobutton(root, text='兵家', variable=v, value=5, indicatoron=True)
rb5.pack()
rb6 = Radiobutton(root, text='阴阳家', variable=v, value=6, indicatoron=True)
rb6.pack()
mainloop()
if __name__ == '__main__':
main()
result

reference
- [文档] docs.python.org/3/library/tkinter.html
resource
- [文档] docs.python.org/3
- [规范] www.python.org/dev/peps/pep-0008
- [规范] zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_rules
- [源码] www.python.org/downloads/source
- [ PEP ] www.python.org/dev/peps
- [平台] www.cnblogs.com
- [平台] gitee.com
Python具有开源、跨平台、解释型和交互式等特性,值得学习。
Python的设计哲学:优雅,明确,简单。提倡用一种方法,最好是只有一种方法来做一件事。
GUI可以选择PyQt5、PySide2、wxPython、PyGObject、wxWidgets等进行创作。
代码的书写要遵守规范,这样有助于沟通和理解。
每种语言都有独特的思想,初学者需要转变思维、踏实践行、坚持积累。
Python3 tkinter基础 Radiobutton indicatoron 改变按钮的外观 圆形/方形的更多相关文章
- Python3 tkinter基础 Radiobutton indicatoron 长条形 pack 充满一行
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Radiobutton variable 默认选中的按钮
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Radiobutton 创建三个单选钮
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Radiobutton 设置相同的value值,产生连锁效果
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Menubutton 点击按钮出现下拉菜单
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Button command 单击按钮 在console中打印文本
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 Button text,fg 按钮上显示的文字 文字的颜色
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 OptionMenu 点击按钮,出现单选的下拉列表
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3 tkinter基础 LabelFrame StringVar 单击按钮,Label中显示的文字更换
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
随机推荐
- [LeetCode] Flip Game II 翻转游戏之二
You are playing the following Flip Game with your friend: Given a string that contains only these tw ...
- Codeforces Round #498 (Div. 3)
被虐惨了,实验室里数十位大佬中的一位闲来无事切题(二,然后出了5t,当然我要是状态正常也能出5,主要是又热又有蚊子什么的... 题都挺水的.包括F题. A: 略 B: 找k个最大的数存一下下标然后找段 ...
- linux安装rabbitmq以及相关的操作命令
1.安装rabbitmqa)进入rabbitmq文件的存放目录b)rpm -ivh rabbitmq-server-3.5.4-1.noarch.rpm2.修改配置cd /etc/rabbitmqcd ...
- Nestjs 获取cookie
Docs yarn add cookie-parser main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } ...
- 在微信下载app引导页代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 记一次maven的包冲突经历
上周工作遇到一个特别棘手的bug,花了我一天时间去搞. 事情是这样的,打包那边的同事过来跟我说我的项目无法运行自动打包,卡在maven package上面,报错为:[error]未经检查的异常,需要捕 ...
- Linux re
正则表达式并不是一个工具程序,而是一个字符串处理的标准依据,如果想要以正则表达式的方式处理字符串,就得使用支持正则表达式的工具,例如grep.vi.sed.asw等. 注意:ls不支持正则表达式. g ...
- ASP.NET Core 实现跨站登录重定向的新姿势
作为 .NET 程序员,痛苦之一是自从 ASP.NET 诞生之日起直到最新的 ASP.NET Core 都无法直接实现跨站登录重定向(比如访问 https://q.cnblogs.com ,跳转到 h ...
- Gym 101194E / UVALive 7901 - Ice Cream Tower - [数学+long double][2016 EC-Final Problem E]
题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?opti ...
- nginx配置框架问题
1.框架源文件没有引入 2.nginx fastcgi.conf配置允许访问上级目录地址 3.使用autoindex on;参数