Created
March 6, 2022 05:26
-
-
Save StuffbyYuki/9c4d012247902fbc2adf489417d972db to your computer and use it in GitHub Desktop.
Python Shell - output history to a file
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 | |
import os # don't necessarily need | |
filePath = os.path.expanduser('~/Downloads/my_history.py') # don't necessarily need | |
readline.write_history_file(filePath) # don't necessarily need | |
# or you can simply do | |
readline.write_history_file('your_file.py') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment