store python code from a notebook cell to a file
During a notebook session I enter a series of SAGE-statements (python code) in a notebook cell. How can I let SAGE store/save this code automatically (not via copy&paste) in a file? The purpose is to reload the stored code in a cell of another session for later processing . I tried to perform this via the "save-session" -command. However, this results in a data volume of several MB, which is much larger than the total length of the code of the session. This I want to avoid.
Yes, saving a session saves everything associated with it, which is a lot of Sage itself. I don't know that there is a way to do this other than simply cut and paste - though I'll point out you can go to "Edit" or something and cut and paste all at once.