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实现查询苹果手机维修进度
Mar 16 Python
Python3中的2to3转换工具使用示例
Jun 12 Python
python编码最佳实践之总结
Feb 14 Python
Python实现图片滑动式验证识别方法
Nov 09 Python
对python中 math模块下 atan 和 atan2的区别详解
Jan 17 Python
python实现根据给定坐标点生成多边形mask的例子
Feb 18 Python
Python环境下安装PyGame和PyOpenGL的方法
Mar 25 Python
Python-jenkins模块获取jobs的执行状态操作
May 12 Python
python调用有道智云API实现文件批量翻译
Oct 10 Python
pycharm 多行批量缩进和反向缩进快捷键介绍
Jan 15 Python
python自动化操作之动态验证码、滑动验证码的降噪和识别
Aug 30 Python
如何通过一篇文章了解Python中的生成器
Apr 02 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
php在线生成ico文件的代码
2007/10/09 PHP
PHP 翻页 实例代码
2009/08/07 PHP
PHP 动态随机生成验证码类代码
2010/04/09 PHP
PHP程序员常见的40个陋习,你中了几个?
2014/11/20 PHP
利用PHP判断文件是否为图片的方法总结
2017/01/06 PHP
js实时监听文本框状态的方法
2011/04/26 Javascript
Chrome Form多次提交表单问题的解决方法
2011/05/09 Javascript
js查错流程归纳
2012/05/04 Javascript
cookie在javascript中的使用技巧以及隐私在服务器端的设置
2012/12/03 Javascript
js修改table中Td的值(定义td的单击事件)
2013/01/10 Javascript
Jquery 表单验证类介绍与实例
2013/06/09 Javascript
JavaScript中的prototype和constructor简明总结
2014/04/05 Javascript
ES6记录异步函数的执行时间详解
2016/08/31 Javascript
网站申请不到支付宝接口、微信接口,免接口收款实现方式几种解决办法
2016/12/14 Javascript
angular中实现控制器之间传递参数的方式
2017/04/24 Javascript
Angular2之二级路由详解
2018/08/31 Javascript
jQuery实现购物车的总价计算和总价传值功能
2018/11/28 jQuery
JQuery样式操作、click事件以及索引值-选项卡应用示例
2019/05/14 jQuery
python使用beautifulsoup从爱奇艺网抓取视频播放
2014/01/23 Python
python中常用的各种数据库操作模块和连接实例
2014/05/29 Python
python操作xml文件详细介绍
2014/06/09 Python
Python处理json字符串转化为字典的简单实现
2016/07/07 Python
Python 确定多项式拟合/回归的阶数实例
2018/12/29 Python
windows下python安装pip方法详解
2020/02/10 Python
Python定时任务APScheduler原理及实例解析
2020/05/30 Python
Django如何重置migration的几种情景
2021/02/24 Python
adidas马来西亚官网:adidas MY
2020/09/12 全球购物
如何保障Web服务器安全
2014/05/05 面试题
建筑专业自荐信范文
2014/01/05 职场文书
办公室秘书岗位职责范本
2014/02/11 职场文书
《再见了,亲人》教学反思
2014/02/26 职场文书
公司联欢晚会主持词
2014/03/22 职场文书
搞笑爱情保证书
2014/04/29 职场文书
知识竞赛拉拉队口号
2014/06/16 职场文书
证婚人致辞精选
2015/07/28 职场文书
浅谈如何提高PHP代码的质量
2021/05/28 PHP