You are viewing an older version (9.10.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.10.0 / IPython / core / magics / history / HistoryMagics / recall

function

IPython.core.magics.history:HistoryMagics.recall

source: /IPython/core/magics/history.py :251

Signature

def   recall ( self arg )

Summary

Repeat a command, or get command to input line for editing.

Extended Summary

%recall and %rep are equivalent.

  • %recall (no arguments):

Place a string version of last computation result (stored in the special '_' variable) to the next input prompt. Allows you to create elaborate command lines without using copy-paste

 In[1]: l = ["hei", "vaan"]
 In[2]: "".join(l)
Out[2]: heivaan
 In[3]: %recall
 In[4]: heivaan_ <== cursor blinking

%recall 45

Place history line 45 on the next input prompt. Use %hist to find out the number.

%recall 1-4

Combine the specified lines into one cell, and place it on the next input prompt. See %history for the slice syntax.

%recall foo+bar

If foo+bar can be evaluated in the user namespace, the result is placed at the next input prompt. Otherwise, the history is searched for lines which contain that substring, and the most recent one is placed at the next input prompt.

Aliases

  • IPython.core.magics.HistoryMagics.recall