How can I tell whether I'm in a Jupyter notebook (new) or a nbclassic notebook, or a Jupyter lab?

33 views Asked by At

It's possible to distinguish Jupyter lab from the other two via: psutil.Process().parent().name() (thanks to How to detect whether in Jupyter Notebook or Lab).

But how can I tell nbclassic notebook from a new? My plugin implementation is quite different for those two. I need a way to tell the difference automatically.

I would potentially need to distinguish those from Google Colab and vscode-jupyter in the future, but currently they are not in my priority list.

0

There are 0 answers