Is there a keyboard shortcut in Pycharm to rename a specific variable?

I am using Pycharm to encode Python, and I want to change the name of a specific variable throughout the code. is there a keyboard shortcut for this operation?

In Matlab, I can use ctrl + shift.

For instance:

old_name=5
x=old_name*123

will become:

new_name=5
x=new_name*123

without having to change both links old_name.

Thank!

+4
source share
2 answers

Highlight old_nameand press Shift+F6

+10
source

, Ctrl + R . , Match case, Regex In.

, , , :

var1 = 0
var1_s = "0"

var1 xy :

xy = 0
xy_s = "0"

.

0

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


All Articles