如何更换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入门篇之文件
Oct 20 Python
详解Python的Django框架中inclusion_tag的使用
Jul 21 Python
Linux下通过python访问MySQL、Oracle、SQL Server数据库的方法
Apr 23 Python
python爬虫的工作原理
Mar 05 Python
Django自定义分页与bootstrap分页结合
Feb 22 Python
python如何通过twisted实现数据库异步插入
Mar 20 Python
numpy中实现二维数组按照某列、某行排序的方法
Apr 04 Python
Python实现数据可视化看如何监控你的爬虫状态【推荐】
Aug 10 Python
eclipse创建python项目步骤详解
May 10 Python
Python中一些深不见底的“坑”
Jun 12 Python
Django框架教程之中间件MiddleWare浅析
Dec 29 Python
如何基于Python爬取隐秘的角落评论
Jul 02 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
php使用curl访问https示例分享
2014/01/17 PHP
ThinkPHP框架任意代码执行漏洞的利用及其修复方法
2014/07/04 PHP
PHP反射机制原理与用法详解
2017/02/15 PHP
PHP实现字符串大小写转函数的功能实例
2019/02/06 PHP
Iframe自适应高度绝对好使的代码 兼容IE,遨游,火狐
2011/01/27 Javascript
jQuery基本过滤选择器使用介绍
2013/04/18 Javascript
输入框过滤非数字的js代码
2014/09/18 Javascript
jQuery中:first选择器用法实例
2014/12/30 Javascript
Jq通过td获取同行其它列td的方法
2016/10/05 Javascript
es6学习笔记之Async函数基本教程
2017/05/11 Javascript
JS实现简单的浮动碰撞效果示例
2017/12/28 Javascript
angular.js和vue.js中实现函数去抖示例(debounce)
2018/01/18 Javascript
用Python编写分析Python程序性能的工具的教程
2015/04/01 Python
Python中pip安装非PyPI官网第三方库的方法
2015/06/02 Python
python集合删除多种方法详解
2020/02/10 Python
python编程进阶之异常处理用法实例分析
2020/02/21 Python
Django 项目布局方法(值得推荐)
2020/03/22 Python
Pytorch实验常用代码段汇总
2020/11/19 Python
用纯css3和html制作泡沫对话框实现代码
2013/03/21 HTML / CSS
HTML5+CSS3 实现灵动的动画 TAB 切换效果(DEMO)
2017/09/15 HTML / CSS
使用css3做0.5px的细线的示例代码
2018/01/18 HTML / CSS
一套比较完整的软件测试人员面试题
2012/05/13 面试题
介绍一下Ruby的多线程处理
2013/02/01 面试题
数控专业毕业生求职信范文
2013/09/21 职场文书
职业规划书如何设计?
2014/01/09 职场文书
人事文员岗位职责
2014/02/16 职场文书
优秀学生干部先进事迹材料
2014/05/26 职场文书
中层干部培训方案
2014/06/16 职场文书
学雷锋志愿者活动总结
2014/06/27 职场文书
运动与健康自我评价
2015/03/09 职场文书
让生命充满爱观后感
2015/06/08 职场文书
李强感恩观后感
2015/06/17 职场文书
2015年重阳节活动主持词
2015/07/30 职场文书
2016年共产党员公开承诺书
2016/03/24 职场文书
Python中glob库实现文件名的匹配
2021/06/18 Python
box-shadow单边阴影的实现
2023/05/21 HTML / CSS