takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
301 stars 58 forks source link

nbopen doesn't create file it it doesn't exist #65

Open ctb opened 4 years ago

ctb commented 4 years ago

e.g. nbopen foo.ipynb opens the JupyterLab interface if foo.ipynb doesn't exist, instead of creating it.

Ideally, it would create an empty file of that name and then open it with jupyter. I bet the tricky bit is that you have to guess at the format of the file based on the name...

ctb commented 4 years ago

Whups! Realized -n/--new does this just fine! I feel like this could/should be the default tho?

takluyver commented 4 years ago

Yup, it should either create the file, or fail consistently with a short, clear error message. At present, it fails with a load of Jupyter messages ending in a reasonable error if there isn't a server running, and opens a 404 page if there is.

I'll have a think about which I prefer.

ctb commented 4 years ago

I like creating the file, personally. I will see if I can hack on this and submit a PR!

takluyver commented 4 years ago

It should be pretty straightforward :-). If you can get a PR in before I've decided what I prefer, I'll go with what you want.