Is it possible to hook up some third-party editor/IDE to view the .py
and somehow connect it to the Python runtime Jupyter/IPython is using?
Yes, it's possible.
Using Emacs as your third party Python IDE.
You can open a file side-by-side with the iPython runtime. It is possible to send definitions from the external file directly to the prompt using key shortcuts, and set breakpoints, single step and inspect variables from the iPython prompt using the standard python debugger pdb.
Auto-completion works fine. Simply writing import XXX makes Emacs aware of all functions within the XXX module.
Here is an example screenshot:

And these are the steps I followed to get to the screenshot.*
- Open file playground.py on Emacs.
- Press
C-c C-p to fire up an iPython process and connect file to it. Note that the iPython process is fully functional. I can call all magic methods on it.
- Press
M-m m d b to include the breakpoint in the line I want (in form of a pdb import)
- Press
C-M-x to send the definition to the iPython prompt. Note in the screenshot that I am calling unique_everseen without ever having typed it into the prompt. The definition was sent directly from the file (that is why we have an empty cell 2, as a visual feedback that Emacs did something).
- Execute the function from iPython prompt so as to trigger the breakpoint. I get information telling me what line I am and enter the debugger automatically.
- I inspect variables to see what is going on.
- I press
n to step to the next instruction.
- I click on the filename (displayed in red on the prompt) and it takes my cursor directly to that line within the playground.py file. Note the black triangles next to the line numbers telling me where the stepper is in. Pretty nice.
Now, I haven't even scratched the surface of what Emacs can offer.
If this interests you I'd suggest looking into it. It's really powerful and has a great, very helpful and active community.
To get all Python configuration running out of the box without having to configure anything yourself simply install Spacemacs, a popular distribution of Emacs (what anaconda is to Python, Spacemacs is to Emacs). The install instructions can be found under the link.
Using Emacs to edit iPython notebooks.
A package called EIN (Emacs iPython Notebooks) "provides a IPython Notebook client and integrated REPL in Emacs."
To get it working you open your iPython notebook server from any terminal with ipython notebook, and call the function ein:notebooklist.
More information can be found under the project's page here, and on the Spacemacs iPython-Notebook layer page here.
In particular, from EIN documentation:
- Copy/paste cells, even to/from different notebooks.
- Console integration: You can easily connect to a kernel via the console application. This enables you to start debugging in the same kernel. It is even possible to connect to a console over ssh.
- An IPython kernel can be "connected" to any Emacs buffer. This enables you to evaluate a buffer or buffer region using the same kernel as the notebook. Notebook goodies such as tooltip help, help browser and code completion are available in these buffers.
- Jump to definition (go to the definition by hitting M-. over an object).
All functionality described above for the simple iPython + file workflow is available for iPython notebooks (*.ipynb).
Screenshots here.