Skip to content

Instantly share code, notes, and snippets.

@florinel-chis
Created March 22, 2021 10:29
Show Gist options
  • Save florinel-chis/ca8c324fa1d8ae7a28c31a81062f0ef4 to your computer and use it in GitHub Desktop.
Save florinel-chis/ca8c324fa1d8ae7a28c31a81062f0ef4 to your computer and use it in GitHub Desktop.
python shell history - one liner
import readline; print('\n'.join([str(readline.get_history_item(i + 1)) for i in range(readline.get_current_history_length())]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment