I use a Jupyter Notebook to write a small program. Therefore, I want to write some cells into a .py file.
I use this magic %%writefile -a myfile.py
. It works, but the problem is that the content is appended without a new line. So, I have to manually add a line break to myfile.py
after running the cells.
How can I avoid this problem?