Closed puzzler10 closed 4 years ago
another_file
needs to have been created by a notebook before. E.g., you need a notebook numbered with a lower index that will default export to another_file
.
Got it! Thanks for that.
I guess what I'm looking for is a way to develop using one Jupyter notebook, and be able to export all the various components to their own files, rather than later creating a new notebook for each class. I'm using AllenNLP now and something like that would make the workflow very easy.
This might also be handy with Pytorch, for example:
from torch.utils.data import Dataset
#export dataset
class SomeDataset(Dataset):
# some code here loading a dataset
#export model
class Model(nn.Module):
# some model code here
#export diagnostics
class Diagnostics:
# misc class for unit testing, output checking
Hi I was looking for the exact same thing. Sure it helps to separate out the notebooks to do their own things, but sometimes we develop multiple components in the same notebook and it helps to export them to different locations
We are tracking this feature request here https://github.com/fastai/nbdev/issues/405
Wondering if there is an easy way to write to two python files from one notebook.
I saw here we could do it with the #export flag, but I'm probably doing something wrong because it's not working for me.
Here is a test script, saved as
testing.ipynb
(blank lines represent cell dividers):I get an error message from notebook2script like:
FileNotFoundError: [Errno 2] No such file or directory: 'pathhere/package_name/another_file.py'
Any thoughts?