I am using pdb to examine a script having called run -d
in an ipython session.
It would be useful to be able to plot some of the variables but I need them in the main ipython environment in order to do that.
So what I am looking for is some way to make a variable available back in the main interactive session after I quit pdb. If you set a variable in the topmost frame it does seem to be there in the ipython session, but this doesn't work for any frames further down.
Something like export
in the following:
ipdb> myvar = [1,2,3]
ipdb> p myvar
[1, 2, 3]
ipdb> export myvar
ipdb> q
In [66]: myvar
Out[66]: [1, 2, 3]