python IDLE 背景以及字體大小的修改方法
為了保護(hù)眼睛,決定把白色背景換掉:
1 首先,在已經(jīng)下載好的python文件目錄下,找到config-highlight.def文件,我的是在H:\python\python3**\Lib\idlelib**文件夾下。
2.打開(kāi)文件后,你會(huì)看到一些默認(rèn)的顏色配置,比如經(jīng)典的顏色配置就是白色背景,一般這個(gè)文件中會(huì)有兩種配置可供選擇:
[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 = #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到剛才打開(kāi)的config-highlight.def文件中,然后重啟shell就可以。
重啟后,shell會(huì)默認(rèn)選擇原來(lái)的。你就在highlighting theme主題中查看,此時(shí)已經(jīng)多了兩種主題,就是你剛才添加的。
主題名字為tango..
大功告成。。
字體的修改
在setting中,如果你設(shè)置的字體是中文字體,再怎么修改大小也是沒(méi)有用的。必須把字體改為英文字體才行。。
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
python實(shí)現(xiàn)網(wǎng)站用戶名密碼自動(dòng)登錄功能
最近接到這樣的需求通過(guò)網(wǎng)頁(yè)用戶認(rèn)證登錄實(shí)現(xiàn)上網(wǎng),如何實(shí)現(xiàn)網(wǎng)站自動(dòng)登錄功能呢,接下來(lái)小編給大家?guī)?lái)了python實(shí)現(xiàn)網(wǎng)站用戶名密碼自動(dòng)登錄功能,需要的朋友可以參考下2019-08-08制作Python數(shù)字華容道的實(shí)現(xiàn)(可選擇關(guān)卡)
這篇文章主要介紹了制作Python數(shù)字華容道的實(shí)現(xiàn)(可選擇關(guān)卡),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04Python操控Chrome瀏覽器進(jìn)行網(wǎng)頁(yè)操作
這篇文章將為您展示如何通過(guò)Python控制瀏覽器實(shí)現(xiàn)網(wǎng)頁(yè)的打開(kāi)、頁(yè)面的切換和關(guān)閉的基本操作,文中的示例代碼講解詳細(xì),感興趣的可以了解一下2023-06-06python3+PyQt5使用數(shù)據(jù)庫(kù)表視圖
這篇文章主要為大家詳細(xì)介紹了python3+PyQt5使用數(shù)據(jù)庫(kù)表視圖,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-04-04Python編程快速上手——strip()函數(shù)的正則表達(dá)式實(shí)現(xiàn)方法分析
這篇文章主要介紹了Python strip()函數(shù)的正則表達(dá)式實(shí)現(xiàn)方法,結(jié)合實(shí)例形式分析了Python基于正則表達(dá)式實(shí)現(xiàn)strip()函數(shù)的方法,需要的朋友可以參考下2020-02-02python使用numpy計(jì)算兩個(gè)框的iou方法示例
這篇文章主要介紹了python使用numpy計(jì)算兩個(gè)框的iou方法示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-08-08在Python的while循環(huán)中使用else以及循環(huán)嵌套的用法
這篇文章主要介紹了在Python的while循環(huán)中使用else以及循環(huán)嵌套的用法,是Python入門學(xué)習(xí)中的基礎(chǔ)知識(shí),需要的朋友可以參考下2015-10-10