Python-Prompt-Toolkit v1.0.4發布

jopen 9年前發布 | 8K 次閱讀 Python python-prompt-toolkit

Python-Prompt-Toolkit是一個用于構建強大的交互式 Python 命令行環境的庫。用好了就變成了 Python 中的 Vim 。

特性:

  • 純 Python.

  • 輸入時語法高亮

  • 多行輸入編輯

  • 高級代碼補全Advanced code completion.

  • Emacs 和 Vi 鍵綁定(類似 readline)

  • 反向和正向增量搜索

  • 可在 Python 2.6 至 3.4 版本運行

  • Unicode 雙寬字符(中文輸入)運行效果很好 。

  • 可選文本復制/粘貼 (Both Emacs and Vi style.)

  • 多輸入緩沖

  • 沒有全局的狀態

  • 輕量級,唯一的依賴是 Pygments,six 和 wcwidth

  • 用心寫的代碼

  • 可在 Linux, OS X, OpenBSD 和 Windows 運行

更新日志

Bug修復:
- Key binding fixes:
      * Improved handling of repeat arguments in Emacs mode. Pressing sequences
        like 'esc---123' do now work (like GNU Readline):
              - repetition of the minus sign is ignored.
              - No esc prefix is required for each digit.
      * Fix in ControlX-ControlX binding.
      * Fix in bracketed paste.
      * Pressing Control-U at the start of the line now deletes the newline.
      * Pressing Control-K at the end of the line, deletes the newline after
        the cursor.
      * Support negative argument for Control-K
      * Fixed cash when left/right were pressed with a negative argument. (In
        Emacs mode.)
      * Fix in ControlUp/ControlDown key bindings.
      * Distinguish backspace from Control-H. They are not the same.
      * Delete in front of the cursor when a negative argument has been given
        to backspace.
      * Handle arrow keys correctly in emacs-term.
- 性能優化:
      * Performance optimization in Registry.
      * Several performance optimization in filters.
      * Import asyncio inline (only if required).
- Use the best possible selector in the event loop. This fixes bugs in
  situations where we have too many open file descriptors.
- Fix UI freeze when gevent monkey patch has been applied.
- Fix segmentation fault in Alpine Linux. (Regarding the use of ioctl.)
- Use the correct colors on Windows. (When the foreground/background colors
  have been modified.)
- Display a better error message when running in Idle.
- Additional flags for vt100 inputs: disable flow control.
- Also patch stderr in CommandLineInterface.patch_stdout_context.

新特性:
- Allow users to enter Vi digraphs in reverse order.
- Improved autocompletion behaviour. See IPython issue #9658.
- Added a 'clear' function in the shortcuts module.

對將來的兼容性:
- `Keys.Enter` has been added. This is the key that should be bound for
  handling the enter key.

  Right now, prompt_toolkit translates \r into \n during the handling of the
  input; this is not correct and makes it impossible to distinguish between
  ControlJ and ControlM. Some applications bind ControlJ for custom handling of
  the enter key, because this equals \n. However, in a future version we will
  stop replacing \r by \n and at that point, the enter key will be ControlM. 
  So better is to use `Keys.Enter`, which becomes an alias for whatever the
  enter key translates into.
 

下載

 

本站原創,轉載時保留以下信息:
本文轉自:深度開源(open-open.com)
原文地址:http://www.baiduhome.net/news/view/2d7b5519

 

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!