如何更换python默认编辑器的背景色


Posted in Python onAugust 10, 2020

初学Python,想必大家拿来练习最多的IDE就是Python自带的IDLE了,但是默认的代码配色及语法高亮主题确实很不适应。下面我们就来看一下修改python默认编辑器背景颜色的方法。

1、首先要找到名为config-highlight.cfg的文件

在Linux系列系统下路径为(~表示用户目录):

~/.idlerc/

在Windows XP下路径为:

C:\Documents and Settings\<用户名>\.idlerc\

在Windows 7下路径为:

C:\Users\<用户名>\.idlerc\

对于Windows可以直接打开开始运行或者在地址栏输入下面的路径确认即可:

%USERPROFILE%\.idlerc\找到这个名叫config-highlight.cfg文件后接下来就需要编辑它了

打开文件后,你会看到一些默认的颜色配置,比如经典的颜色配置就是白色背景,一般这个文件中会有两种配置可供选择:

[IDLE Classic]和[IDLE New]

表现在IDLE界面上就是在python shell下,选择options—configure IDLE—-highlighting选项中,右侧的highlighting theme主题选择。

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

[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默认编辑器的背景色

到此这篇关于如何更换python默认编辑器的背景色的文章就介绍到这了,更多相关python默认编辑器的背景色更换方法内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

Python 相关文章推荐
打包发布Python模块的方法详解
Sep 18 Python
python3+PyQt5实现支持多线程的页面索引器应用程序
Apr 20 Python
Python日期时间对象转换为字符串的实例
Jun 22 Python
Python读取excel中的图片完美解决方法
Jul 27 Python
python3.6实现学生信息管理系统
Feb 21 Python
用Python中的turtle模块画图两只小羊方法
Apr 09 Python
Python面向对象之类和实例用法分析
Jun 08 Python
Django发送邮件功能实例详解
Sep 02 Python
pytorch模型预测结果与ndarray互转方式
Jan 15 Python
详解python中各种文件打开模式
Jan 19 Python
python numpy生成等差数列、等比数列的实例
Feb 25 Python
python使用OpenCV模块实现图像的融合示例代码
Apr 10 Python
django前端页面下拉选择框默认值设置方式
Aug 09 #Python
解决Django响应JsonResponse返回json格式数据报错问题
Aug 09 #Python
django 获取字段最大值,最新的记录操作
Aug 09 #Python
在django中查询获取数据,get, filter,all(),values()操作
Aug 09 #Python
Python 使用双重循环打印图形菱形操作
Aug 09 #Python
Python 添加文件注释和函数注释操作
Aug 09 #Python
vscode配置anaconda3的方法步骤
Aug 08 #Python
You might like
thinkphp3.x中cookie方法的用法分析
2016/05/19 PHP
被jQuery折腾得半死,揭秘为何jQuery为何在IE/Firefox下均无法使用
2010/01/22 Javascript
javascript学习笔记(八) js内置对象
2012/06/19 Javascript
jQuery 数据缓存模块进化史详细介绍
2012/11/19 Javascript
javaScript对文字按照拼音排序实现代码
2013/12/27 Javascript
基于JavaScript实现瀑布流布局(二)
2016/01/26 Javascript
Angular中使用ui router实现系统权限控制及开发遇到问题
2016/09/23 Javascript
jQuery EasyUI ProgressBar进度条组件
2017/02/28 Javascript
jQuery输入框密码的显示隐藏【代码分享】
2017/04/29 jQuery
详解vue-router 2.0 常用基础知识点之router-link
2017/05/10 Javascript
vue实现动态显示与隐藏底部导航的方法分析
2019/02/11 Javascript
vue实现购物车抛物线小球动画效果的方法详解
2019/02/13 Javascript
Vue+Express实现登录注销功能的实例代码
2019/05/05 Javascript
vue 取出v-for循环中的index值实例
2019/11/09 Javascript
高性能js数组去重(12种方法,史上最全)
2019/12/21 Javascript
JS数组Reduce方法功能与用法实例详解
2020/04/29 Javascript
vue输入框使用模糊搜索功能的实现代码
2020/05/26 Javascript
[00:44]TI7不朽珍藏III——军团指挥官不朽展示
2017/07/15 DOTA
python中的多重继承实例讲解
2014/09/28 Python
用Python编写一个简单的Lisp解释器的教程
2015/04/03 Python
MySQL中表的复制以及大型数据表的备份教程
2015/11/25 Python
完美解决python中ndarray 默认用科学计数法显示的问题
2018/07/14 Python
pyecharts调整图例与各板块的位置间距实例
2020/05/16 Python
Python matplotlib读取excel数据并用for循环画多个子图subplot操作
2020/07/14 Python
python3 kubernetes api的使用示例
2021/01/12 Python
Canvas 帧动画吃苹果小游戏
2020/08/05 HTML / CSS
Expedia挪威官网:酒店、机票和租车
2018/03/03 全球购物
Electrolux伊莱克斯巴西商店:家用电器、小家电和配件
2018/05/23 全球购物
Skip Hop官网:好莱坞宝宝挚爱品牌
2018/06/17 全球购物
澳大利亚领先的孕妇服装品牌:Mamaway
2018/08/14 全球购物
入党积极分子自我鉴定范文
2014/03/25 职场文书
商场开业庆典策划方案
2014/06/02 职场文书
个人职业及收入证明
2014/10/13 职场文书
质检员工作总结2015
2015/04/25 职场文书
公司与个人合作协议书
2016/03/19 职场文书
MySQL中的布尔值,怎么存储false或true
2021/06/04 MySQL