Is there a debugging feature in any IDE that allows you to see which “path” your code took?

So, I am debugging a huge piece of code, and this is a huge task. The code includes many conditional (if / else) statements and to facilitate this work for debugging, I would like to see which "path" the interpreter went through all if / elses.

For example:

if stuff:
    x = "stuff"
elif otherstuff:
    x = "otherstuff"
else:
    x = "evenmorestuff"
return x

My actual code is much more complicated than that, and posting returninstead is xnot an option. But I hope you understand this idea.

I would like to see which “path” through ifs, elifs and elses my code takes when it crashes. For example:

|  if stuff:
>      x = "stuff"            (ran this line)
 |     if morestuff:
 |         y = "morestuff"    (skipped this line)
 |     else:
 >         y = "nostuff"      (ran this line)
  |elif otherstuff:
  |    x = "otherstuff"       (skipped this line)
  |else:
  |    x = "evenmorestuff"    (skipped this line)
  >return x                   (ran this line)

- IDE, ? ( Visual Studio Community 2015 PTVS Python, , , , IDE.) , , google , - , .

:)

+4
1

, , "".

Python trace, . , .

, . , , .

, / .

+3

Source: https://habr.com/ru/post/1617920/


All Articles