The contents of a code cell(s) can be written to a Python file. This is quite helpful while taking code from prototyping in Jupyter Notebook to production environments in Python files. These files are written to the current working directory:
Figure 9.69: LaTex snippet for writing a code cell to a Python file