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 相关文章推荐
Tornado Web服务器多进程启动的2个方法
Aug 04 Python
python超简单解决约瑟夫环问题
May 12 Python
Python创建模块及模块导入的方法
May 27 Python
python中kmeans聚类实现代码
Feb 23 Python
python数据封装json格式数据
Mar 04 Python
python实现简单http服务器功能
Sep 17 Python
解决python 自动安装缺少模块的问题
Oct 22 Python
Python父目录、子目录的相互调用方法
Feb 16 Python
PyTorch搭建一维线性回归模型(二)
May 22 Python
Django中使用MySQL5.5的教程
Dec 18 Python
Python unittest装饰器实现原理及代码
Sep 08 Python
Python用SSH连接到网络设备
Feb 18 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
《五等分的花嫁》漫画完结!2020年10月第2期TV动画制作组换血!
2020/03/06 日漫
PHP中time(),date(),mktime()区别介绍
2013/09/28 PHP
使用PHP静态变量当缓存的方法
2013/11/13 PHP
收藏一些不常用,但是有用的代码
2007/03/12 Javascript
javascript如何动态加载表格与动态添加表格行
2013/11/27 Javascript
浅谈javascript 迭代方法
2015/01/21 Javascript
详细分析使用AngularJS编程中提交表单的方式
2015/06/19 Javascript
jQuery实现带有上下控制按钮的简单多行滚屏效果代码
2015/09/04 Javascript
深入理解jquery跨域请求方法
2016/05/18 Javascript
js实现表单及时验证功能 用户信息立即验证
2016/09/13 Javascript
easyui datagrid 大数据加载效率慢,优化解决方法(推荐)
2016/11/09 Javascript
js实现鼠标左右移动,图片也跟着移动效果
2017/01/25 Javascript
利用JQUERY实现多个AJAX请求等待的实例
2017/12/14 jQuery
详解react-native WebView 返回处理(非回调方法可解决)
2018/02/27 Javascript
JS双向链表实现与使用方法示例(增加一个previous属性实现)
2019/01/31 Javascript
[49:02]KG vs Infamous 2019国际邀请赛淘汰赛 败者组BO1 8.20.mp4
2020/07/19 DOTA
[52:06]完美世界DOTA2联赛决赛日 Inki vs LBZS 第一场 11.08
2020/11/10 DOTA
Python3连接MySQL(pymysql)模拟转账实现代码
2016/05/24 Python
Python注释详解
2016/06/01 Python
Python 描述符(Descriptor)入门
2016/11/20 Python
Python 常用 PEP8 编码规范详解
2017/01/22 Python
Python错误处理操作示例
2018/07/18 Python
Python中super函数用法实例分析
2019/03/18 Python
解决python3中的requests解析中文页面出现乱码问题
2019/04/19 Python
windows系统中Python多版本与jupyter notebook使用虚拟环境的过程
2019/05/15 Python
关于Python 中的时间处理包datetime和arrow的方法详解
2020/03/19 Python
python求前n个阶乘的和实例
2020/04/02 Python
pyx文件 生成pyd 文件用于 cython调用的实现
2021/03/04 Python
英国高档时尚男装购物网站:MR PORTER
2016/08/09 全球购物
党旗在我心中演讲稿
2014/09/15 职场文书
土建施工员岗位职责
2015/04/11 职场文书
高三生物教学反思
2016/02/22 职场文书
介绍信应该怎么开?
2019/04/03 职场文书
python使用pywinauto驱动微信客户端实现公众号爬虫
2021/05/19 Python
Python合并多张图片成PDF
2021/06/09 Python
Python pyecharts案例超市4年数据可视化分析
2022/08/14 Python