Hi everyone. This might sound incredibly stupid, but I was wondering if there was a way to convert .py scripts to .ipynb notebooks, especially if the scripts are kind of well “segmented” by multi-line comment blocks alternating with code blocks.
A bit of context: I cloned the entire PyTorch tutorial repo so that I could work through it on my own pace. The Tutorials website has notebooks available for each lesson but I’ll have to download them individually (the notebook URLs do not follow any discernable pattern either which I might be able to exploit with wget). For e.g.
-
autograd tutorial notebook: https://pytorch.org/tutorials/_downloads/009cea8b0f40dfcb55e3280f73b06cc2/autograd_tutorial.ipynb
-
the tensors tutorial notebook: https://pytorch.org/tutorials/_downloads/3c2b25b8a9f72db7780a6bf9b5fc9f62/tensor_tutorial.ipynb
Both these tutorials are in the “blitz” directory in the repo as .py scripts here. The repo has only .py files but no notebooks.
Help?