Hi,
When I create a new notebook like so
const nbPanel: NotebookPanel = await app.commands.execute(
'notebook:create-new',
{ kernelName: 'python3', activate: true }
);
I can then call nbPanel.revealed
on it, which opens up the notebook with python3 selected as the kernel.
I’m trying to accomplish the same thing using DocumentManager’s open/openOrReveal methods.
Here, the file already exists and I want to just open it with a pre-defined kernel.
await app.commands.execute('docmanager:open', {
path: 'Untitled.ipynb'
})
However this will open the file and asks the user to select a kernel:
I want to pre-set this so that the ‘python3’ kernel is automatically selected and attached to the notebook before opening it.
From the docs, here there is a parameter to pass in the kernel
.
I’ve spent a lot of time trying to create a new python3 kernel and passing it in the parameter but to no avail, I’ve also tried to create a WidgetFactory and see if that could help but unfortunately hit a dead end.
Any advice on how I can accomplish this?