- Create a file
~/.pythonrc.py
- 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
- Export the environment variable (add this to
~/.bashrc
or~/.zshrc
)export PYTHONSTARTUP="/home/jfaria/.pythonrc.py"