takluyver/nbopen

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

ctb opened this issue · 4 comments

ctb commented

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

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

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

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.