Reputation: 50220
Before I open an IPython notebook, I'd like to check whether it is in a directory that is already being served by a server process. The goal is to connect to that server instead of launching yet another server for the same directory.
Background: I often work with IPython notebooks in several different directories, and since one server can only handle one directory hierarchy, I have to launch several separate notebook servers. As far as I know this cannot be avoided unless I move all my notebooks into the same directory hierarchy, right? But at least I want to avoid launching more servers than necessary. If I could check for the existence of a suitable server (and get the connection ID), I could connect to it instead of launching a new one.
Upvotes: 2
Views: 1166
Reputation: 50220
Running ipython notebook help
or ipython notebook -h
gives the answer. Who knew?
Subcommands
Subcommands are launched as
ipython-script.py cmd [args]
. For information on using subcommand 'cmd', do:ipython cmd -h
.list List currently running notebook servers in this profile.
Curiously the above list is both incomplete (the subcommand help
is not mentioned) and incorrect: The correct invocation is ipython notebook list
, not ipython list
.
% ipython notebook list
Upvotes: 3