debugging - Python Visual Debugger -


i know there thousand posts on debugging in python can't find looking for....a visual debugger. example:

one@localhost ~ $ cat duh.py     import pdb class coordinate(object):      pdb.set_trace()      def __init__(self, x, y):          self.x = x          self.y = y      def __repr__(self):          return "coord: " + str(self.__dict__) def add(a, b):      return coordinate(a.x + b.x, a.y + b.y) def sub(a, b):     return coordinate(a.x - b.x, a.y - b.y)  1 = coordinate(100,200) 2 = coordinate(300,200)  add(one, two) 

i want see values being used. instead of seeing def __init__(self, x, y): see def __init__(self, 100, 200):

> /home/one/duh.py(14)<module>() -> 1 = coordinate(100,200) (pdb) s --call-- > /home/one/duh.py(4)__init__() -> def __init__(self, x, y): (pdb) s > /home/one/duh.py(5)__init__() -> self.x = x (pdb) s > /home/one/duh.py(6)__init__() -> self.y = y (pdb) s --return-- > /home/one/duh.py(6)__init__()->none -> self.y = y 

can help? i'm totally not used being blind on going on inside of interpreter , see going on in internals other scripting language debuggers(like javascript step throughs)

that pdb debugging doesn't fun. can see why don't it.

fortunately, there are visual python debuggers out there. 2 use commercial products, both worth cost. komodo ide , intellij idea. these multi-language ides support many other languages in addition python. there python-only version of idea called pycharm.

there's great free option, winpdb. it's easy use: once install , open it, use file/launch , enter full path .py file, , can start debugging.

those products multiplatform, if you're on windows free option microsoft's python tools visual studio. can install either commercial visual studio 2015 or free community edition of visual studio 2015.

to give idea, here screenshots of code winpdb, komodo , idea. stepped __init__ function in each:

enter image description here  

enter image description here  

enter image description here

don't worry if don't code font used; that's personal setting. , of course in normal use screen not cramped; made small fit in screenshot.

i highly recommend of these visual debuggers - it's great able step through code single keystroke , watch variables change go.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -