by d33 · 10y ago · 0 comments
One thing I'm missing in interactive interpreters is a way to save code to a file on the fly - testing things and preparing the output file in one go. Does anybody know a solution to this for, say, Python?
It opens your system editor and then runs the code on save. (-p opens the last edited thing from within the current ipython session)
For example "%save mycode.py 1-10" saves the code input on lines 1 through 10 of the session to the file "mycode.py".