Enthought Canopy中的IPython缓冲区和分页 [英] IPython buffer and pagination in Enthought Canopy

查看:141
本文介绍了Enthought Canopy中的IPython缓冲区和分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上使用Enthought的Python Canopy 0.9.1 beta版本。如何增加IPython缓冲区的大小。另外我如何通过分页器管道输出命令;输出目前处于取消状态。

I'm using Enthought's beta distribution of Python Canopy 0.9.1 on Windows 7. How do I increase the size of my IPython buffer. Also how do I pipe the output of a command through a paginator; output is currently unpaginated.

如果现有答案如
如何增加ipython qtconsole回滚缓冲区限制
如何在ipython中使用Pipe 会起作用,我不知道如何将它们应用到Windows。

If existing answers like How to increase the ipython qtconsole scrollback buffer limit or How to use Pipe in ipython will work, I don't know how to apply them to Windows.

谢谢!

推荐答案

目前没有首选项或配置选项来增加缓冲区限制,但是你可以创建一个宏使用以下代码,并运行它。

There's currently no preference or config option to increase the buffer limit currently, but you could create a macro with the following code, and run it.

def run():
    code_task = get_active_task()
    python_pane = code_task.python_pane
    python_pane.frontend.control.buffer_size = 1000

设置 buffer_size 到一个非正值,将关闭缓冲区的剪切,但是这个IPython开发人员不推荐选项。

Setting the buffer_size to a non-positive value, will turn off clipping of the buffer, but this option is "not recommended" by the IPython devs.

要创建新的宏,


  1. 转到工具(菜单)>编辑宏...

  2. 单击创建新宏按钮并为宏指定合适的名称。

  3. 将上面的代码复制到宏中

  4. 或者,您可以通过单击键绑定文本框添加用于运行此宏的键盘快捷键在右下角,按下所需的键组合。如果您选择不设置键盘快捷键,则可以从工具>运行宏。运行宏> (你的宏)

  1. go to Tools (Menu) > Edit Macros ...
  2. Click on the "Create a new macro" button and give the macro a suitable name.
  3. Copy the code above, into your macro
  4. Optionally, you can add a keyboard shortcut for running this macro, by clicking on the keybinding text box in the bottom right, and pressing the desired key-combination. If you choose not to set a keyboard shortcut, you can run the macro from Tools > Run Macro > (your macro)

这篇关于Enthought Canopy中的IPython缓冲区和分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆