IPython Magic for working with Spyder
I use Spyder for data analysis and exploration. My usual workflow goes like this:
- Hack in the IPython terminal until I get the results I want
- Save the good code to a script
- Repeat steps 1 and 2 until something breaks
- Whoops! Had to restart Spyder!
- Re-run parts of my code from the script
- Continue hacking (step 1)!
Spyder had great built in support for running parts of a script in IPython (step 5). You can use cells!
Unfortunately, there is no quick way to save the good lines from IPython to the editor. This pr
Example:
%scrinit scratch.py
Start a new scratch file
Examples:
%scr
%scr 42
Appends code from IPython cell to scratch file. If no cell number is provided, it saves the previous cell. If you have not run %scrinit
the code is saved to scratch.py