禁用iPython Notebook自动滚动 [英] Disable iPython Notebook Autoscrolling

查看:456
本文介绍了禁用iPython Notebook自动滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPython Notebook中,是否可以禁用长输出的自动滚动?或者至少在自动滚动设置之前设置输出长度的阈值?

In iPython Notebook, is it possible to disable the autoscrolling of long outputs? Or at least set a threshold for the output length before autoscrolling sets in?

尝试以下命令

%%javascript
IPython.OutputArea.auto_scroll_threshold = 9999;

但是它出错了

Javascript error adding output!
SyntaxError: Unexpected identifier
See your browser Javascript console for more details.


推荐答案

要禁用自动滚动,请执行此javascript执行其他单元格之前的笔记本单元格:

To disable auto-scrolling, execute this javascript in a notebook cell before other cells are executed:

%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
    return false;
}

还有一个ipython笔记本扩展, disable_autoscroll ,您可以使用更持久的更改。请关注 ipython issue#2172 了解最新详情。

There is also an ipython notebook extension, disable_autoscroll, you can use for a more permanent change. Follow ipython issue #2172 for the latest details.

这篇关于禁用iPython Notebook自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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