问题
I have a program with many formulas and variables. I need to change the name of some of these variables. Is there any command or function in Spyder that can help me change all the names in one step?
I am looking for something like the Matlab's MAIUSC+ENTER.
回答1:
1) Select the variable you want to change, then Press CTRL + R
2) Enter the new variable name you want. (in replace by)
3) Replace all
回答2:
No way to do it currently. It's an open issue. https://github.com/spyder-ide/spyder/issues/415
回答3:
Alternatively, PyCharm can be used instead of Spyder, which is now supported in Anaconda.
In PyCharm: Select the variable > Right Click > Refactor > Rename
来源:https://stackoverflow.com/questions/23295576/changing-variable-name-in-spyder