I have a Jupyter notebook(parent.ipynb
) which runs another notebook(child.ipynb
) inside it.
Is there a way to get the filename of the parent file from inside the child file? My child file has a logger and therefore can be called by multiple files. It needs to know which file is calling the logger to create log records and therefore I was wondering if there is any magic
or any sort of method that can help me with this.
Basically,
A.ipynb
[1] %run B.ipynb
B.ipynb
-- insert code that can print parent filename when called --