python IDLE 背景以及字体大小的修改方法


Posted in Python onJuly 12, 2019

为了保护眼睛,决定把白色背景换掉:

1 首先,在已经下载好的python文件目录下,找到config-highlight.def文件,我的是在H:\python\python3**\Lib\idlelib**文件夹下。

2.打开文件后,你会看到一些默认的颜色配置,比如经典的颜色配置就是白色背景,一般这个文件中会有两种配置可供选择:
[IDLE Classic]和 [IDLE New],表现在IDLE界面上就是在python shell下,选择options—configure IDLE—-highlighting选项中,右侧的highlighting theme主题选择,有两种可选方案,就上文件中的那两种。

3.如果直接在源文件上修改颜色有些麻烦,除非你特别熟悉颜色。网上有经典的背景配置:

[Obsidian]
definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
cursor-foreground = #E0E2E4
break-background = #293134
comment-foreground = #66747B
hilite-background = #2F393C
hilite-foreground = #E0E2E4
definition-background = #293134
stderr-background = #293134
hit-background = #000000
console-foreground = #E0E2E4
normal-background = #293134
builtin-foreground = #E0E2E4
stdout-background = #293134
console-background = #293134
stderr-foreground = #FB0000
keyword-background = #293134
string-foreground = #EC7600
break-foreground = #E0E2E4
error-background = #293134

[tango]
definition-foreground = #fce94f
error-foreground = #fa8072
string-background = #2e3436
keyword-foreground = #8cc4ff
normal-foreground = #ffffff
comment-background = #2e3436
hit-foreground = #ffffff
break-foreground = #000000
builtin-background = #2e3436
stdout-foreground = #eeeeec
cursor-foreground = #fce94f
hit-background = #2e3436
comment-foreground = #73d216
hilite-background = #edd400
definition-background = #2e3436
stderr-background = #2e3436
break-background = #2e3436
console-foreground = #87ceeb
normal-background = #2e3436
builtin-foreground = #ad7fa8
stdout-background = #2e3436
console-background = #2e3436
stderr-foreground = #ff3e40
keyword-background = #2e3436
string-foreground = #e9b96e
hilite-foreground = #2e3436
error-background = #2e3436

直接把上面的代码copy到刚才打开的config-highlight.def文件中,然后重启shell就可以。

重启后,shell会默认选择原来的。你就在highlighting theme主题中查看,此时已经多了两种主题,就是你刚才添加的。

python IDLE 背景以及字体大小的修改方法

主题名字为tango..

大功告成。。

字体的修改

在setting中,如果你设置的字体是中文字体,再怎么修改大小也是没有用的。必须把字体改为英文字体才行。。

python IDLE 背景以及字体大小的修改方法

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Python 相关文章推荐
举例讲解Python程序与系统shell交互的方式
Apr 09 Python
Python中动态创建类实例的方法
Mar 24 Python
使用XML库的方式,实现RPC通信的方法(推荐)
Jun 14 Python
详解Python里使用正则表达式的ASCII模式
Nov 02 Python
对python中使用requests模块参数编码的不同处理方法
May 18 Python
PyCharm安装第三方库如Requests的图文教程
May 18 Python
Jupyter notebook 启动闪退问题的解决
Apr 13 Python
关于Python解包知识点总结
May 05 Python
django 模型字段设置默认值代码
Jul 15 Python
Python图像处理二值化方法实例汇总
Jul 24 Python
python安装sklearn模块的方法详解
Nov 28 Python
python如何查找列表中元素的位置
May 30 Python
Python-Tkinter Text输入内容在界面显示的实例
Jul 12 #Python
Python爬虫抓取技术的一些经验
Jul 12 #Python
python 使用装饰器并记录log的示例代码
Jul 12 #Python
如何使用python爬虫爬取要登陆的网站
Jul 12 #Python
Pycharm使用之设置代码字体大小和颜色主题的教程
Jul 12 #Python
python增加图像对比度的方法
Jul 12 #Python
Python 控制终端输出文字的实例
Jul 12 #Python
You might like
thinkphp模板继承实例简述
2014/11/26 PHP
PHP接收json 并将接收数据插入数据库的实现代码
2015/12/01 PHP
在WordPress中获取数据库字段内容和添加主题设置菜单
2016/01/11 PHP
ie支持function.bind()方法实现代码
2012/12/27 Javascript
JS 按钮点击触发(兼容IE、火狐)
2013/08/07 Javascript
JS:window.onload的使用介绍
2013/11/13 Javascript
javascript刷新父页面的各种方法汇总
2014/09/03 Javascript
jQuery实现ichat在线客服插件
2014/12/29 Javascript
深入探寻seajs的模块化与加载方式
2015/04/14 Javascript
jquery.fastLiveFilter.js实现输入自动过滤的方法
2015/08/11 Javascript
使用Object.defineProperty实现简单的js双向绑定
2016/04/15 Javascript
BootStrap 获得轮播中的索引和当前活动的焦点对象
2017/05/11 Javascript
Node.JS利用PhantomJs抓取网页入门教程
2017/05/19 Javascript
深入Vue-Router路由嵌套理解
2018/08/13 Javascript
详解vue在项目中使用百度地图
2019/03/26 Javascript
vue使用Sass时报错问题的解决方法
2020/10/14 Javascript
Javascript Symbol原理及使用方法解析
2020/10/22 Javascript
python中while循环语句用法简单实例
2015/05/07 Python
Python中用altzone()方法处理时区的教程
2015/05/22 Python
Python使用zip合并相邻列表项的方法示例
2018/03/17 Python
Python编写一个优美的下载器
2018/04/15 Python
Python中作用域的深入讲解
2018/12/10 Python
Python中six模块基础用法
2019/12/08 Python
python requests模拟登陆github的实现方法
2019/12/26 Python
python3 os进行嵌套操作的实例讲解
2020/11/19 Python
python unichr函数知识点总结
2020/12/16 Python
canvas绘制视频封面的方法
2018/02/05 HTML / CSS
linux比较文件内容的命令是什么
2015/09/23 面试题
毕业生自荐书模版
2014/01/04 职场文书
招聘单位介绍信
2014/01/14 职场文书
投标承诺函格式
2015/01/21 职场文书
2015年党员岗位承诺书
2015/04/27 职场文书
SQL注入的实现以及防范示例详解
2021/06/02 MySQL
Python OpenCV实现传统图片格式与base64转换
2021/06/13 Python
深入理解以DEBUG方式线程的底层运行原理
2021/06/21 Java/Android
浅谈Python中的正则表达式
2021/06/28 Python