%recall: Repeat a command, or get command to input line for editing.
%recall (along with its alias
%rep) repeats a command, and places the resulting output into a new line input. This allows you to create elaborate command lines without relying on copying and pasting.
In : grocery_list = ['apples', 'bananas', 'soup', 'ice cream'] In : ", ".join(grocery_list) Out: 'apples, bananas, soup, ice cream' In : %recall In : apples, bananas, soup, ice cream # <= The cursor will be waiting here
You can also place lines from history (find out by using
%history -n) on the next input prompt:
In : a = 'foo' In : b = 'bar' In : c = a + ' ' + b In : c Out: 'foo bar' In : %recall 7 In : c = a + ' ' + b # <= The cursor will be waiting here