Different Methods to Create Python Files in Jupyter Notebook

Dr. Shouke Wei
4 min readJul 30, 2022

Jupyter Notobook is one excellent IDE for Python Developers

From this article, I will introduce some pretty handy features that we should know earlier. If you are interested in learning July notebooks, please follow me, and then you will not miss one of them.

We can create .py files easily in other IDE, such as PyCharm, VS Code, Spyder, only name few. Many people think Jupyter note can only create .ipynb extension files, which is short for Ipython Jupyter Notebook. Actually, there are several ways to create Python (.py) extension files. In this article, I will display four handy ways to create Python (.py) extension files, which can be run directly in other Python IDEs.

1. Use built-in text editor

Go to the New drop-down button in the top-right on the Dashboard, and select Text File to open the text editor.

Fig. 1. Open Built-in Text Editor of Jupyter Notebook

Rename the file to any name with .pyextension first. For example, we rename the file to hi.py. I stress first here because the code will indent automatically only when you change the file name to .pyfile first. Otherwise, you have to indent codes…

--

--

Dr. Shouke Wei

Professor and Scientist in data analysis and modelling, machine learnig, and computer vision. Support my writing: https://medium.com/@shouke.wei/membership