ÓãCÂÛ̳

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á

2016-12-23 Python3.4µÄ°²×°ÓëÅäÖÃ

ÒÑÓÐ 532 ´ÎÔĶÁ2016-12-23 23:35

Python3.4 : °²×°ÅÌ:/Python34/
   pip          : °²×°ÅÌ:/Python34/Scripts/
°ÑÉÏÃæÕâÁ½¸ö·¾¶¼ÓÈëϵͳ»·¾³±äÁ¿µ±ÖÐÈ¥

ΪpythonÅäÖñ³¾°É«(win7)
%USERPROFILE%\.idlerc\ -> ÊäÈëµ½´°¿ÚµØÖ·À¸ -> н¨Îļþ config-highlight.cfg
[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
ÖØÆôIDLE,ÒÀ´ÎÑ¡ Options -> Configure IDLE -> Highlighting -> a Custom Theme -> tango,Obsidian Á½¸öÅäÉ«·½°¸Ñ¡ÈÎÑ¡Ò»¸ö

python idle ÇåÆÁctrl + l (win7)
ÔÚ °²×°ÅÌ:\Python34\Lib\idlelib\Ŀ¼ÏÂн¨ClearWindow.py,¸´ÖÆÒÔÏ´úÂëµ½ÎļþÖÐ,
"""
Clear Window Extension
Version: 0.2
Author: Roger D. Serwy
roger.serwy@gmail.com
Date: 2009-06-14
"""
class ClearWindow:

    menudefs = [
    ('options', [None,
    ('Clear Shell Window', '<<clear-window>>'),
    ]),]

    def __init__(self, editwin):
    self.editwin = editwin
    self.text = self.editwin.text
    self.text.bind("<<clear-window>>", self.clear_window2)

    self.text.bind("<<undo>>", self.undo_event) # add="+" doesn't work

    def undo_event(self, event):
    text = self.text

    text.mark_set("iomark2", "iomark")
    text.mark_set("insert2", "insert")
    self.editwin.undo.undo_event(event)

    # fix iomark and insert
    text.mark_set("iomark", "iomark2")
    text.mark_set("insert", "insert2")
    text.mark_unset("iomark2")
    text.mark_unset("insert2")


def clear_window2(self, event): # Alternative method
    # work around the ModifiedUndoDelegator
    text = self.text
    text.undo_block_start()
    text.mark_set("iomark2", "iomark")
    text.mark_set("iomark", 1.0)
    text.delete(1.0, "iomark2 linestart")
    text.mark_set("iomark", "iomark2")
    text.mark_unset("iomark2")
    text.undo_block_stop()
    if self.text.compare('insert', '<', 'iomark'):
    self.text.mark_set('insert', 'end-1c')
    self.editwin.set_line_and_column()

def clear_window(self, event):
    # remove undo delegator
    undo = self.editwin.undo
    self.editwin.per.removefilter(undo)

    # clear the window, but preserve current command
    self.text.delete(1.0, "iomark linestart")
    if self.text.compare('insert', '<', 'iomark'):
    self.text.mark_set('insert', 'end-1c')
    self.editwin.set_line_and_column()

    # restore undo delegator
    self.editwin.per.insertfilter(undo)

È»ºóÔÚ °²×°ÅÌ:\Python34\Lib\idlelib\config-extensions.defÎļþµÄ×îºóÌí¼ÓÒÔÏÂ
[ClearWindow]
enable=1
enable_editor=0
enable_shell=1
[ClearWindow_cfgBindings]
clear-window=<Control-Key-l>
±£´æ²¢Í˳ö, ´Ëʱ´ò¿ªpython shell -> Options ->Äã»á·¢ÏÖ Clear Shell Windows Ctrl+L



·¹ý

¼¦µ°

ÏÊ»¨

ÎÕÊÖ

À×ÈË

ÆÀÂÛ (0 ¸öÆÀÂÛ)

facelist

ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔÆÀÂÛ µÇ¼ | Á¢¼´×¢²á

СºÚÎÝ|ÊÖ»ú°æ|Archiver|ÓãC¹¤×÷ÊÒ ( ÔÁICP±¸18085999ºÅ-1 | ÔÁ¹«Íø°²±¸ 44051102000585ºÅ)

GMT+8, 2024-5-1 20:34

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

·µ»Ø¶¥²¿