Issue
I'm writing a bash script that ends by launching jupyter-lab and (ideally) opening a specific notebook.
In jupyter, this is easy to do:
$ jupyter notebook my_folder/my_notebook.ipynb
I can't find any guidance for how to do this in jupyter-lab. Ideas?
Solution
This seems not to be documented in great detail but there are at least two ways of opening specific files:
Simply using the jupyter lab
command (see this comment)
$ jupyter lab my_folder/my_notebook.ipynb
or using the Jupyter URLs. First, you start the jupyter lab server, without browser and then open an URL locating the file of choice:
$ jupyter lab --no-browser &
$ sensible-browser http(s)://<server:port>/<lab-location>/lab/tree/path/to/notebook.ipynb
where sensible-browser
can be replaced by the browser of your choice (e.g. google-chrome
or firefox
) and specific URL parts can be retrieved from the URL displayed by the first command (possibly one could extract and assemble the URL automatically).
The Jupyter URLs seem to be a bit more customizable (offering the choice of workspace, etc).
Answered By - krassowski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.