為了保護(hù)眼睛,決定把白色背景換掉:
1 首先,在已經(jīng)下載好的Python文件目錄下,找到config-highlight.def文件,我的是在H:\python\python3**\Lib\idlelib**文件夾下。
2.打開文件后,你會看到一些默認(rèn)的顏色配置,比如經(jīng)典的顏色配置就是白色背景,一般這個(gè)文件中會有兩種配置可供選擇:
[IDLE Classic]和
[IDLE New],表現(xiàn)在IDLE界面上就是在python shell下,選擇options—configure IDLE—-highlighting選項(xiàng)中,右側(cè)的highlighting theme主題選擇,有兩種可選方案,就上文件中的那兩種。
3.如果直接在源文件上修改顏色有些麻煩,除非你特別熟悉顏色。網(wǎng)上有經(jīng)典的背景配置:
[Obsidian]definition-foreground = #678CB1error-foreground = #FF0000string-background = #293134keyword-foreground = #93C763normal-foreground = #E0E2E4comment-background = #293134hit-foreground = #E0E2E4builtin-background = #293134stdout-foreground = #678CB1cursor-foreground = #E0E2E4break-background = #293134comment-foreground = #66747Bhilite-background = #2F393Chilite-foreground = #E0E2E4definition-background = #293134stderr-background = #293134hit-background = #000000console-foreground = #E0E2E4normal-background = #293134builtin-foreground = #E0E2E4stdout-background = #293134console-background = #293134stderr-foreground = #FB0000keyword-background = #293134string-foreground = #EC7600break-foreground = #E0E2E4error-background = #293134[tango]definition-foreground = #fce94ferror-foreground = #fa8072string-background = #2e3436keyword-foreground = #8cc4ffnormal-foreground = #ffffffcomment-background = #2e3436hit-foreground = #ffffffbreak-foreground = #000000builtin-background = #2e3436stdout-foreground = #eeeeeccursor-foreground = #fce94fhit-background = #2e3436comment-foreground = #73d216hilite-background = #edd400definition-background = #2e3436stderr-background = #2e3436break-background = #2e3436console-foreground = #87ceebnormal-background = #2e3436builtin-foreground = #ad7fa8stdout-background = #2e3436console-background = #2e3436stderr-foreground = #ff3e40keyword-background = #2e3436string-foreground = #e9b96ehilite-foreground = #2e3436error-background = #2e3436
直接把上面的代碼copy到剛才打開的config-highlight.def文件中,然后重啟shell就可以。
重啟后,shell會默認(rèn)選擇原來的。你就在highlighting theme主題中查看,此時(shí)已經(jīng)多了兩種主題,就是你剛才添加的。
主題名字為tango..
大功告成。。
在setting中,如果你設(shè)置的字體是中文字體,再怎么修改大小也是沒有用的。必須把字體改為英文字體才行。。