def print_history (self): length = readline.get_current_history_length() for i in range(1, length + 1): cmd = readline.get_history_item(i) print("{:<5} {:}".format(i, cmd))