Marc Wouts
1 min readDec 16, 2018

--

Thanks Hayder. This is very interesting. Yes, the ‘attach’ method is clearly more adapted to notebooks that take a long time to run.

Also, as you mention, there are a series of configurations in which attaching Python processes does not work (did you try the workaround from the PyCharm documentation in the case of recent Ubuntu?).

May I mention your contribution in the other article? If I summarize:

  • you call the breakpoint function from any place in the notebook, including deep in methods or functions, and you give the variables you want to examine to the breakpoint function,
  • the breakpoint function looks like
def brkpt(*args, **kwargs):
"""Import this method in your Jupyter notebook, and call it at the desired location for breakpoints. Attach the Jupyter kernel in PyCharm, and set a breakpoint on the line below. You will be able to watch arguments in PyCharm, and evaluate expressions on combinations of these arguments"""
return
  • and then you use PyCharm as a local variable explorer, and an environnement where you can evaluate local expressions.

--

--

Marc Wouts
Marc Wouts

Written by Marc Wouts

Author of Jupytext and ITables. I love maths, data visualization and programming in mixed languages

Responses (2)