configure jupyter to spawn all new notebooks on the same port & server?

57 views
Skip to first unread message

Denis Akhiyarov

unread,
Jun 29, 2017, 1:03:59 PM6/29/17
to Project Jupyter

I'm using basic integration of .ipynb files with Windows Explorer:

 

https://github.com/ContinuumIO/anaconda-issues/issues/267

 

However each notebook spawns a new notebook server.

 

Is there any way to force spawning new notebooks in the same notebook server & port using config files from jupyter?


Here are the settings that I have for notebook integration with file manager:

 

in CMD:

assoc .ipynb=IPYNBFILE
ftype IPYNBFILE="C:\Python\Python35\Scripts\ipython.exe" notebook "%%1"

In Registry (RegEdit)

[HKEY_CLASSES_ROOT\Directory\Background\shell\ipynb]
@="Open IPython Notebook server here"
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\ipynb\command]
@="\"C:\\Python\\Python35\\Scripts\\ipython.exe\" \"notebook\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\ipynb]
@="Open IPython Notebook server here"
 
[HKEY_CLASSES_ROOT\Directory\shell\ipynb\command]
@="\"C:\\Python\\Python35\\Scripts\\ipython.exe\" \"notebook\" \"%1\""

Andreas Hilboll

unread,
Jun 29, 2017, 1:07:22 PM6/29/17
to jup...@googlegroups.com
Denis,

this should be possible by writing your own wrapper script. Currently,
you start the ipython.exe process with "notebook" and your filename as
parameters.

You should be able to write a script, say, "notebookwrapper.cmd", in
which you check if there already is an ipython.exe process running, and
if so, use the appropriate command line. Maybe you have to work with a
lockfile or the like.

This script, you would then use as

assoc .ipynb=IPYNBFILE
ftype IPYNBFILE="C:\path\to\notebookwrapper.cmd" "%%1"

Sorry to be a bit vague, but this should be enough to get you thinking
into the right direction. Unfortunately I cannot help in more detail
since I don't know Windows.

Cheers,
Andreas.

Denis Akhiyarov writes:

> I'm using basic integration of .ipynb files with Windows Explorer:
>
> https://github.com/ContinuumIO/anaconda-issues/issues/267
>
> However each notebook spawns a new notebook server.
>
> Is there any way to force spawning new notebooks in the same notebook
> server & port using config files from jupyter?
>
> in CMD:
>
> assoc .ipynb=IPYNBFILE
> ftype IPYNBFILE="C:\Python\Python35\Scripts\ipython.exe" notebook "%%1"
>
> In Registry (Regedit)
>
> [HKEY_CLASSES_ROOT\Directory\Background\shell\ipynb]
> @="Open IPython Notebook server here"
>
> [HKEY_CLASSES_ROOT\Directory\Background\shell\ipynb\command]
> @="\"C:\\Python\\Python35\\Scripts\\ipython.exe\" \"notebook\" \"%1\""
>
> [HKEY_CLASSES_ROOT\Directory\shell\ipynb]
> @="Open IPython Notebook server here"
>
> [HKEY_CLASSES_ROOT\Directory\shell\ipynb\command]
> @="\"C:\\Python\\Python27\\Scripts\\ipython.exe\" \"notebook\" \"%1\""

Denis Akhiyarov

unread,
Jun 29, 2017, 1:30:58 PM6/29/17
to Project Jupyter
Hi Andreas,

Looks like your suggestion is still not possible even with a wrapper script:


So I guess let me give a try to nbopen again.

Thanks,
Denis

Matthias Bussonnier

unread,
Jun 29, 2017, 2:22:21 PM6/29/17
to jup...@googlegroups.com
Don't forget to migrate from 'ipython notebook' to 'jupyter notebook' the CL argument parsing may be different.
-- 

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/9a701c28-8c6a-43e7-8f2f-9ce06775bf46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Kluyver

unread,
Jul 3, 2017, 8:23:46 AM7/3/17
to Project Jupyter
On 29 June 2017 at 18:07, Andreas Hilboll <hil...@uni-bremen.de> wrote:
You should be able to write a script, say, "notebookwrapper.cmd", in
which you check if there already is an ipython.exe process running, and
if so, use the appropriate command line.  Maybe you have to work with a
lockfile or the like.

nbopen is such a script :-)

https://github.com/takluyver/nbopen

Denis Akhiyarov

unread,
Jul 3, 2017, 7:48:06 PM7/3/17
to Project Jupyter
Anyone using nbopen on Windows, install from master with these commands:

pip install flit
flit installfrom github
:takluyver/nbopen

More details here:

Reply all
Reply to author
Forward
0 new messages