Skip to content

Instantly share code, notes, and snippets.

@j-faria
Last active October 7, 2020 13:20
Embed
What would you like to do?
Auto-reload modules in IPython
  1. Create a file ~/.pythonrc.py
  2. Add
try:
    from IPython import get_ipython
    get_ipython().run_line_magic('load_ext', 'autoreload')
    get_ipython().run_line_magic('autoreload', '2')
except AttributeError:
    pass
  1. Export the environment variable (add this to ~/.bashrc or ~/.zshrc) export PYTHONSTARTUP="/home/jfaria/.pythonrc.py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment