Pycharm Debugger Variable Variable

When I debug Python code in Pycharm, I often want to change some of the variables that are set by the source code.
I can do this through the Debugger tab, click on the appropriate variable and use the Set Value function to change it. It clicks too much, and I would prefer to do it through the console interface. But when I try to do this, it does not update the variable:

>>> filename
Out[6]: 'a'
>>> filename='b'
>>> filename
Out[8]: 'a'

Is there a way to change these types of variables through the console interface?

+4
source share
3 answers

Use the magic button

You can do it completely. When stopped at a breakpoint:

  • A " Python"
  • python B, ,
  • C

: - ( → > C ) , , . , .

+5

, , . , , . , .

+3

, , , , ( ) .

. :

>>> var_obj.temp = 1
>>> var_obj
Out[2]: namespace(temp=1)
>>> var_obj.temp2 = 2
>>> var_obj.temp = 10
>>> var_obj
Out[5]: namespace(temp=10, temp2=2)
>>> var_simple = 10
>>> var_simple
Out[7]: 1

Tracker PyCharm 2013 (. ). , PyCharm 3, , python, PyCharm, .

, , , - .

+2

All Articles