python IDLE 背景以及字體大小的修改方法
為了保護眼睛,決定把白色背景換掉:
1 首先,在已經(jīng)下載好的python文件目錄下,找到config-highlight.def文件,我的是在H:\python\python3**\Lib\idlelib**文件夾下。
2.打開文件后,你會看到一些默認的顏色配置,比如經(jīng)典的顏色配置就是白色背景,一般這個文件中會有兩種配置可供選擇:
[IDLE Classic]和 [IDLE New],表現(xiàn)在IDLE界面上就是在python shell下,選擇options—configure IDLE—-highlighting選項中,右側(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到剛才打開的config-highlight.def文件中,然后重啟shell就可以。
重啟后,shell會默認選擇原來的。你就在highlighting theme主題中查看,此時已經(jīng)多了兩種主題,就是你剛才添加的。

主題名字為tango..
大功告成。。
字體的修改
在setting中,如果你設(shè)置的字體是中文字體,再怎么修改大小也是沒有用的。必須把字體改為英文字體才行。。

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Python將Excel轉(zhuǎn)換為多種圖片格式的方法(PNG, JPG, BMP, SVG)
有時,你可能希望以圖片形式分享Excel數(shù)據(jù),以防止他人對數(shù)據(jù)進行修改或編輯,將Excel轉(zhuǎn)換為圖片可以將數(shù)據(jù)鎖定為靜態(tài)圖片,確保數(shù)據(jù)的完整性和準確性,這篇文章將探討如何使用Python實現(xiàn)將Excel工作表轉(zhuǎn)換為多種圖片格式,如PNG,JPG,BMP和SVG,需要的朋友可以參考下2025-03-03
Python?Decorator裝飾器的創(chuàng)建方法及常用場景分析
這篇文章主要介紹了Python?Decorator裝飾器的創(chuàng)建方法及常用場景,裝飾器可以分成方法裝飾器和類裝飾器,他們的區(qū)別是一個是用函數(shù)實現(xiàn)的裝飾器,一個是用類實現(xiàn)的裝飾器,他們也都能在方法和類上進行裝飾,需要的朋友可以參考下2022-07-07
windows10系統(tǒng)中安裝python3.x+scrapy教程
本文給大家主要介紹了在windows10系統(tǒng)中安裝python3以及scrapy框架的教程以及有可能會遇到的問題的解決辦法,希望大家能夠喜歡2016-11-11
Github?Copilot的申請以及在Pycharm的配置與使用詳解
GitHub在聯(lián)合OpenAI推出了一款"GitHub Copilot"工具,可以根據(jù)上下文自動寫代碼,下面這篇文章主要給大家介紹了關(guān)于Github?Copilot的申請以及在Pycharm的配置與使用的相關(guān)資料,文中通過圖文以及實例代碼介紹的非常詳細,需要的朋友可以參考下2022-04-04
Python連接PostgreSQL數(shù)據(jù)庫的方法
大家應該都有所了解,python可以操作多種數(shù)據(jù)庫,諸如SQLite、MySql、PostgreSQL等,這里不對所有的數(shù)據(jù)庫操作方法進行贅述,只針對目前項目中用到的PostgreSQL做一下簡單介紹,主要是Python連接PostgreSQL數(shù)據(jù)庫的方法。有需要的朋友們可以參考借鑒,下面來一起看看吧。2016-11-11
python如果快速判斷數(shù)字奇數(shù)偶數(shù)
這篇文章主要介紹了python如果快速判斷數(shù)字奇數(shù)偶數(shù),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下2019-11-11

