This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import readline | |
def history(tail_length=50): | |
total = readline.get_current_history_length() | |
for i in range(total - tail_length, total): | |
print(readline.get_history_item(i + 1)) | |
""" | |
Meant to be used from the Python interactive shell. The function will print the | |
last several lines of command history. Default is 50 lines. |