When writing code in Python (basically numpy + matplotlib), I usually just type the code in vim and run a program to check it:
python2 foo.py
Sometimes, when this is not enough, and I need to study the problem more carefully, I just run the program in ipython:
ipython -pylab foo.pyand then check the variables, check some commands and so on. I like ipythonit because of the completion of the tab and the presence of bash commands.
This worked well enough for me, but now my programs got bigger and included a lot of routines (in multiple files). The approach ipythonno longer works, as it always executes the complete code to the end foo.py(when it falls into the pylab shell). Instead, I would like to stop, stop execution on a given line in a subroutine (maybe in another file), and check the variables there. those. set the break point at which the sawable sheath enters.
Is there an easy way to adapt my ipythonway of working? For instance. line stopbar.py
ipython -pylab --stop-at bar.py:423 foo.py
or, stop at the name of the subroutine in bar.py
ipython -pylab --stop-at bar.py:subroutine-name foo.py
source
share