I\'m working on the default python interpreter on Mac OS X, and I Cmd+K (cleared) my earlier commands. I can go through them one by one using the arrow
Since the above only works for python 2.x for python 3.x (specifically 3.5) is similar but with a slight modification:
import readline
for i in range(readline.get_current_history_length()):
print (readline.get_history_item(i + 1))
note the extra ()
(using shell scripts to parse .python_history or using python to modify the above code is a matter of personal taste and situation imho)