Python IDLE背景主題

來源:互聯網
上載者:User

標籤:它的   python學習   編輯   int   number   setting   for   並且   檔案   

相信剛進入python學習之路的朋友們,都還是挺喜歡python內建的IDLE,但是白的代碼背景色以及其它的代碼色確實讓人看著有點不舒服,所以當時也琢磨著能不能自己給它換換顏色,這個當然可以,廢話不多說,直接切入主題:

上面是我的,大家讀完設定自己喜歡的顏色吧

1、首先要找到名為config-Highlight.cfg的這個檔案,這個檔案的位置大概如下:

在Linux系列系統下路徑為(~表示使用者目錄): 
~/.idlerc/

在Windows XP下路徑為: 
C:\Documents and Settings\<使用者名稱>.idlerc\

在Windows 7下路徑為: 
C:\Users\<使用者名稱>.idlerc\

對於Windows可以直接開啟開始運行或者在地址欄輸入下面的路徑確認即可: 
%USERPROFILE%.idlerc\

找到這個名叫config-Highlight.cfg檔案後接下來就需要編輯它了,有的可能找不到這個檔案,那我們就新創新建立一個名為config-Highlight.cfg 的檔案。

2、建立檔案之後,添加如下代碼(和我上面的顏色一樣;大家喜歡的就直接用,不喜歡的就自己調):
[Obsidian]definition-foreground = #ff8080error-foreground = #FF0000string-background = #494949keyword-foreground = #e1031enormal-foreground = #5ca404comment-background = #293134hit-foreground = #E0E2E4builtin-background = #293134stdout-foreground = #678CB1cursor-foreground = #E0E2E4break-background = #293134comment-foreground = #5ae100hilite-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 = #ff0000error-foreground = #fa8072string-background = #2e3436keyword-foreground = #f8a80dnormal-foreground = #ffff00comment-background = #2f2f2fhit-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
3、建立並且添加代碼完畢之後,還沒結束,現在我們去IDLE中選定我們的主題,這時如果已經開啟Python IDLE,儲存檔案後重啟IDLE,開啟後依次選擇菜單上Options – Configure IDLE…
    選擇Highlighting選項卡,然後Select選擇a Custom Theme,如所示,選擇剛才配置的兩個主題之一,我這裡選擇tango。

 

 

 

(需要自己配置顏色的看5)

4、完成配置後點擊Apply或OK,看看效果,在Highlighting選項卡旁邊有個Fonts/Tabs選項卡,可以用來配置字型和縮排寬度的。5、需要自己配置顏色的繼續看,直接,簡單易懂:

原文傳送門

Python IDLE背景主題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.