<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                Readline 庫的快捷鍵綁定和其它一些參數可以通過名為?~/.inputrc?的初始化文件的替換命名來定制。快捷鍵綁定如下形式: `key-name: function-name` 或者: `"string": function-name` 選項可以如下設置: `set option-name value` 例如: ~~~ # I prefer vi-style editing: set editing-mode vi # Edit using a single line: set horizontal-scroll-mode On # Rebind some keys: Meta-h: backward-kill-word "\C-u": universal-argument "\C-x\C-r": re-read-init-file ~~~ 需要注意的是 Python 中默認?Tab?綁定為插入一個?Tab?字符而不是 Readline 庫的默認文件名完成函數,如果你想用這個,可以將以下內容插入: `Tab: complete` 到你的?~/.inputrc?中來覆蓋它。(當然,如果你真的把?Tab?設置成這樣,就很難在后繼行中插入縮進。) 自動完成變量和模塊名也可以激活生效。要使之在解釋器交互模式中可用,在你的啟動文件中加入下面內容:?[[1]](http://www.pythondoc.com/pythontutorial3/interactive.html#id7) ~~~ import rlcompleter, readline readline.parse_and_bind('tab: complete') ~~~ 這個操作將?Tab?綁定到完成函數,故按 Tab 鍵兩次會給出建議的完成內容;它查找 Python 命名、當前的局部變量、有效的模塊名。對于類似?string.a?這樣的文件名,它會解析?'.'?相關的表達式,從返回的結果對象中獲取屬性,以提供完成建議。需要注意的是,如果對象的__getattr__()?方法是此表達式的一部分,這可能會執行應用程序定義代碼。 更有用的初始化文件可能是下面這個例子這樣的。要注意一旦創建的名字沒用了,它會刪掉它們;因為初始化文件作為解釋命令與之在同一個命名空間執行,在交互環境中刪除命名帶來了邊際效應。可能你發現了它體貼的保留了一些導入模塊,類似?os?,在解釋器的大多數使用場合中都會用到它們。 ~~~ # Add auto-completion and a stored history file of commands to your Python # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is # bound to the Esc key by default (you can change it - see readline docs). # # Store the file in ~/.pystartup, and set an environment variable to point # to it: "export PYTHONSTARTUP=~/.pystartup" in bash. import atexit import os import readline import rlcompleter historyPath = os.path.expanduser("~/.pyhistory") def save_history(historyPath=historyPath): import readline readline.write_history_file(historyPath) if os.path.exists(historyPath): readline.read_history_file(historyPath) atexit.register(save_history) del os, atexit, readline, rlcompleter, save_history, historyPath ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看