I have just written a bunch of lines of code on the Python prompt at the terminal. Now, I want to save all those lines of code to a .py
file.
I am unable to find out how to do that. The only thing that I could find on StackOverflow was this answer but it shows only how to do it in an iPython notebook. I am not using an iPython notebook. I am running the code at the command line on the terminal.
I tried to follow that answer (because just in case) and ran the %save
magic command on the terminal but it gave a SyntaxError
.
So, how do save it?
Thanks!