Lavanya Lavanya - 1 year ago 86
Python Question

how do you see the entire command history in interactive python?

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 keys. But is there an option like the --history option in bash shell, which shows you all the commands you've entered so far?

Answer Source

Use readline.get_current_history_length() to get the length, and readline.get_history_item() to view each.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download