0

Im coming from a MatLab background, and started to pick up Python. In matlab it generates a table of the last value of any parameter while excecuting the code. It really helps in debugging.

is there anything simillar in Python, or is ironning the bugs out, soley based on print('...') to see the values of interest?

mioumitsou
  • 47
  • 1
  • 1
  • 7
  • 2
    "is there anything simillar in Python, or is ironning the bugs out, soley based on print('...') to see the values of interest?" Seems like a [false dichotomy](https://en.wikipedia.org/wiki/False_dilemma). – John Coleman Dec 18 '22 at 00:21
  • "Parameter" means "variable" in this context, right? I've never used MatLab. If so, check out [How to step through Python code to help debug issues?](/q/4929251/4518341) The answers cover a bunch of debugging tools, most of which include a table of variables. – wjandrea Dec 18 '22 at 05:17

2 Answers2

2

Some IDEs, for example, PyCharm, provide the ability to debug. enter image description here

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
2

Well you can use a proper debugger in python. In Pycharm it's the little bug to the right of the run button.

left: run right: debugger

You can then use break points to stop the code at any time. This is done by clicking to the right of the line number.

a break point

If your program hits that break point the program will pause.

hit break point

if your program is in a paused state you can navigate trough your code with these buttons

debugger buttons

Teddy
  • 452
  • 1
  • 12