Created
August 11, 2015 06:30
-
-
Save nnathan/309e078c43131718b56b to your computer and use it in GitHub Desktop.
Per-virtualenv history for IPython
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 sys | |
import os | |
c = get_config() | |
# per-virtualenv history (for Python 2.x) | |
if hasattr(sys, 'real_prefix'): | |
venv_name = os.path.basename(sys.prefix) | |
c.HistoryManager.hist_file = os.path.join( | |
os.path.dirname(__file__), 'history-{}.sqlite'.format(venv_name) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment