Skip to content

Instantly share code, notes, and snippets.

@dazza-codes
Created December 6, 2022 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dazza-codes/036cad533e74250c4bf08bff92dd7dc6 to your computer and use it in GitHub Desktop.
Save dazza-codes/036cad533e74250c4bf08bff92dd7dc6 to your computer and use it in GitHub Desktop.
Python History
#!/usr/bin/env python3
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