Issue
I can't install the ipdb package because it's on a server over which I have no control. I want to make the following work.
import other.module.ipdb as ipdb
print 'hello'
ipdb.set_trace()
print 'world'
Ipython is installed which makes me think I should somehow be able to access the ipdb package. I know locally I did installed it by doing sudo apt-get install python-ipdb
but it seems that ipdb should already be available somehow.
Any ideas?
Thank you
Solution
You are right that IPython comes with everything you need to be able to use the ipdb
package. Here's how you can access it as long as you have IPython installed:
from IPython.core.debugger import Pdb
ipdb = Pdb()
Then you can use ipdb
just as though you had done import ipdb
, such as:
ipdb.runcall(self, func, *args, **kwds)
ipdb.run(self, cmd, globals=None, locals=None)
# etc.
Answered By - Scott H
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.