Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to watch a variable with PyCharm? [duplicate]

Is it possible to "watch" a variable with PyCharm? I want to see the values a variable takes on as it runs through a loop.

Or is there something like console.log()? I am aware of breakpoints (I don't want to break), print and pprint :). It would be awesome to click open a list or object for example.

like image 525
Christof Avatar asked Nov 18 '16 13:11

Christof


1 Answers

Use the "Watches" pane, this shows how to find it: Pycharm - How do I access the "Watches" pane?

screenshot

You can just drag variables from the "Variables" pane into it.

You can also watch expressions, e.g. var + 1.

Breaking when a variable changes however is currently not possible: Stop at the line where a variable gets changed