I am copying Python code from Jupyter Notebook to .py file to run it from a terminal. I could not find a way how this line should be implemented:
%%writefile -a submission.py
What is the same code in regular Python as %%writefile magic command does?