📝

【Python】How to exchange to .py from .ipynb

2024/08/29に公開

0. Who is this article for

If you want to exchange to the .py file from .ipynb file, and using VSCode, and not working below command, you are the target of this article.

# pupular command
jupyter nbconvert --to script your_notebook.ipynb

1. What should you do

In vscode, right-click the file, and select "import notebook to script".
Then you can get the .py file from .ipynb file.

So easy.

2. Additional

Why do I write this article? because I was facing a multi-processing problem in the pytorch environment.
The .ipynb environment cause the error, so I searched the way to exchange the file type.

Discussion