arnodel at googlemail.com
Sat Mar 22 12:07:33 CET 2008
On Mar 22, 10:07 am, John Machin <sjmac... at lexicon.net> wrote:
> On Mar 22, 7:19 pm, castiro... at gmail.com wrote:
> > On the other hand, are you willing to make changes to the console?
> > How big and what? I was thinking of __ to keep the second-to-last
> > most recent command.
> Access to and editing of previous input lines is already provided by
> the cooked mode of the console (e.g. on Windows, lean on the up-arrow
> key) or can be obtained by installing the readline package. Perhaps by
> analogy with _, you mean the *result* of the penultimate *expression*.
> This functionality would be provided by the Python interactive
> interpreter but it's not ... do have a look at IPython (http://
> ipython.scipy.org/moin/About); I don't use it but I get the impression
> that if it doesn't already keep a stack or queue of recent results,
> you could implement it yourself easily.
As you guessed, __ and ___ have the expected meaning in IPython.
moreover the nth output in the session is stored in _n.
More information about the Python-list