IPython is an enhanced interactive Python shell. This note captures two handy magic commands.
- Saving your REPL session to a script for later reuse.
pip install ipython# save lines 1-48 of the current session to a file
%save filename 1-48
# save the command history to a python file
%hist -f my_history.py