From 152e7c057038616a514ca55d596dc4c8d5925433 2011-10-17 02:22:38
From: Fernando Perez <Fernando.Perez@berkeley.edu>
Date: 2011-10-17 02:22:38
Subject: [PATCH] Update info on connecting to existing notebook kernels with qtconsole.

---

diff --git a/docs/source/interactive/htmlnotebook.txt b/docs/source/interactive/htmlnotebook.txt
index 05c9f6d..5b7cfcb 100644
--- a/docs/source/interactive/htmlnotebook.txt
+++ b/docs/source/interactive/htmlnotebook.txt
@@ -132,15 +132,31 @@ console, is that it can not run any code that expects input from the kernel
 that the ``%debug`` magic does *not* work in the notebook!  We intend to
 correct this limitation, but in the meantime, there is a way to debug problems
 in the notebook: you can attach a Qt console to your existing notebook kernel,
-and run ``%debug`` from the Qt console.  Simply look for the lines in the
-terminal where you started the kernel that read something like::
+and run ``%debug`` from the Qt console.  If your notebook is running on a local
+computer (i.e. if you are accessing it via your localhost address at
+127.0.0.1), you can just type ``%qtconsole`` in the notebook and a Qt console
+will open up connected to that same kernel.
+
+In general, the notebook server prints the full details of how to connect to
+each kernel at the terminal, with lines like:
 
     [IPKernelApp] To connect another client to this kernel, use:
-    [IPKernelApp] --existing --shell=53328 --iopub=53817 --stdin=34736 --hb=45543
+    [IPKernelApp] --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json
+
+This is the name of a JSON file that contains all the port and validation
+information necessary to connect to the kernel.  You can manually start a
+qt console with::
+
+    ipython qtconsole --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json
+
+and if you only have a single kernel running, simply typing::
 
-and then start a qt console pointing to that kernel::
+    ipython qtconsole --existing
 
-    ipython qtconsole --existing --shell=53328 --iopub=53817 --stdin=34736 --hb=45543
+will automatically find it (it will always find the most recently started
+kernel if there is more than one).  You can also request this connection data
+by typing ``%connect_info``; this will print the same file information as well
+as the content of the JSON data structure it contains.
 
     
 Text input