本文介绍了如何在Spyder的IPython控制台中查看所有命令的控制台历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Spyder的IPython控制台中,我只能看到最新执行的命令-前者从控制台窗口中消失了.

In my IPython console in Spyder I can see only the latest executed commands -- as the former disappear from the console window.

我想知道是否有某种方法-例如通过调整一些参数-在Spyder的IPython控制台中查看所有命令的控制台历史记录.

I wonder if there is some way --e.g. by adjusting some parameter-- to see the console history of all commands in the IPython console in Spyder.

你能帮我吗?谢谢!

推荐答案

如果在Ipython控制台中键入%quickref,您将看到一个类似于以下内容的部分:

If you type %quickref in the Ipython console you'll see one section that looks like this:

History:

_i, _ii, _iii    : Previous, next previous, next next previous input
_i4, _ih[2:5]    : Input history line 4, lines 2-4
exec _i81        : Execute input history line #81 again
%rep 81          : Edit input history line #81
_, __, ___       : previous, next previous, next next previous output
_dh              : Directory history
_oh              : Output history
%hist            : Command history of current session.
%hist -g foo     : Search command history of (almost) all sessions for 'foo'.
%hist -g         : Command history of (almost) all sessions.
%hist 1/2-8      : Command history containing lines 2-8 of session 1.
%hist 1/ ~2/     : Command history of session 1 and 2 sessions before current.
%hist ~8/1-~6/5  : Command history from line 1 of 8 sessions ago to
                   line 5 of 6 sessions ago.
%edit 0/         : Open editor to execute code with history of current session.

其中一个命令应该执行您想要的操作...

One of those commands should do what you want...

这篇关于如何在Spyder的IPython控制台中查看所有命令的控制台历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 14:18
查看更多