经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 程序设计 » Python » 查看文章
python IDLE 背景以及字体大小的修改方法
来源:jb51  时间:2019/7/12 10:57:03  对本文有异议

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

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

  1. [Obsidian]
  2. definition-foreground = #678CB1
  3. error-foreground = #FF0000
  4. string-background = #293134
  5. keyword-foreground = #93C763
  6. normal-foreground = #E0E2E4
  7. comment-background = #293134
  8. hit-foreground = #E0E2E4
  9. builtin-background = #293134
  10. stdout-foreground = #678CB1
  11. cursor-foreground = #E0E2E4
  12. break-background = #293134
  13. comment-foreground = #66747B
  14. hilite-background = #2F393C
  15. hilite-foreground = #E0E2E4
  16. definition-background = #293134
  17. stderr-background = #293134
  18. hit-background = #000000
  19. console-foreground = #E0E2E4
  20. normal-background = #293134
  21. builtin-foreground = #E0E2E4
  22. stdout-background = #293134
  23. console-background = #293134
  24. stderr-foreground = #FB0000
  25. keyword-background = #293134
  26. string-foreground = #EC7600
  27. break-foreground = #E0E2E4
  28. error-background = #293134
  29.  
  30. [tango]
  31. definition-foreground = #fce94f
  32. error-foreground = #fa8072
  33. string-background = #2e3436
  34. keyword-foreground = #8cc4ff
  35. normal-foreground = #ffffff
  36. comment-background = #2e3436
  37. hit-foreground = #ffffff
  38. break-foreground = #000000
  39. builtin-background = #2e3436
  40. stdout-foreground = #eeeeec
  41. cursor-foreground = #fce94f
  42. hit-background = #2e3436
  43. comment-foreground = #73d216
  44. hilite-background = #edd400
  45. definition-background = #2e3436
  46. stderr-background = #2e3436
  47. break-background = #2e3436
  48. console-foreground = #87ceeb
  49. normal-background = #2e3436
  50. builtin-foreground = #ad7fa8
  51. stdout-background = #2e3436
  52. console-background = #2e3436
  53. stderr-foreground = #ff3e40
  54. keyword-background = #2e3436
  55. string-foreground = #e9b96e
  56. hilite-foreground = #2e3436
  57. error-background = #2e3436

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

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

主题名字为tango..

大功告成。。

字体的修改

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

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

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号