如何增加ipython qtconsole回滚缓冲区限制 [英] How to increase the ipython qtconsole scrollback buffer limit
问题描述
当我使用以下任何一个加载ipython时:
When I load ipython with any one of:
ipython qtconsole
ipython qtconsole --pylab
ipython qtconsole --pylab inline
输出缓冲区仅保留最后500行。要查看此次运行:
The output buffer only holds the last 500 lines. To see this run:
for x in range(0, 501):
...: print x
是否有配置选项?
我试过调整--cache-size但这似乎没什么区别。
Is there a configuration option for this? I've tried adjusting --cache-size but this does not seem to make a difference.
推荐答案
很快:
ipython qtconsole --IPyWidget.buffer_size = 1000
ipython qtconsole --IPythonWidget.buffer_size=1000
或者您可以通过添加以下内容来永久设置:
Or you can set it permanently by adding:
c.IPythonWidget.buffer_size=1000
$ b你的ipython配置文件中的
$ b
。
in your ipython config file.
为了发现这类事情,一个有用的技巧是:
For discovering this sort of thing, a helpful trick is:
ipython qtconsole --help-all | grep PATTERN
例如,你已经有了'缓冲',所以:
For instance, you already had 'buffer', so:
$> ipython qtconsole --help-all | grep -C 3 buffer
...
--IPythonWidget.buffer_size=<Integer>
Default: 500
The maximum number of lines of text before truncation. Specifying a non-
positive number disables text truncation (not recommended).
如果IPython使用了与您预期不同的名称并且第一次搜索没有显示任何内容,那么您可以使用 500
,因为您知道要更改的值是什么,这也会找到相关的配置。
If IPython used a different name than you expect and that first search turned up nothing, then you could use 500
, since you knew what the value was that you wanted to change, which would also find the relevant config.
这篇关于如何增加ipython qtconsole回滚缓冲区限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!