hist -n -- print line numbershist -g -- print history for your past sessions (not just the current one)hist -f filename.py -- writes history lines to filename.pyhist -l 10 -- will limit output to last 10 lineshist -g timeit -- will filter lines that contain the string "timeit"hist -u -g timeit -- same as filter, but will only print unique lineshist -o -n -- also print outputs history?? in iPython will give you similar info.hist -n 1/hist -n 1/20 - means one session back, and 20th input linehist -n 2/20 - means two sessions back, and 20th input linehist -n 20 (i.e. without the sign) defaults to the current ipython session.rerun <history reference>rerun 20 will execute line 20 of the current sessionrerun ~1/20 will execute line 20 of the previous sessionrerun 88-90 will execute lines 88,89, 90 of historyrecall <history reference>recall 42 -- will recall line 42, and give you the prompt for editingrecall myfunc -- will recall the most recent line containing myfunc, withe the same effect.save filename.py <history reference>save mymodule.py 22-40 25 -- Saves lines 22-40, 25 to file mymodule.pysave -a -- will appendhist -g <reg exp>hist -g func1 -- will list all history lines containing "func1" hist -gn func1 -- same thing. adds line numbersedit <history reference> edit 24 28 47 - loads the lines in order, in your configured ipython editor
In [ 165 ] : def myfunc():
print "hello"
....
In [200] : edit 165 # opens line 165 in editor we made changes to that func w/o saving it to a file
out[200]: def myfunc()\n print "hello" \n
....
...
In [210]: edit _oh[200] # loads the func in editor
In [1] : def myfunc()
print "hello"
In [2] edit myfunc
I came looking for how to list all history (including previous sessions). Maybe add the answer?: %history -g See: http://stackoverflow.com/questions/25124037/ipython-print-complete-history-not-just-current-session
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.