I know this is possible. I've seen "ArjanCodes" on youtube do it. However I do think he uses VScode instead of Pycharm but Im sure it can also be done on Pycharm. Either way. Do you know how to do this on whatever IDE you use? Heres some code to explain what Im talking about.
Now keep in mind, I know this code doesnt make any sense at all. Its just something I typed up really quick to make an example. So what I want to do is quickly rename all of the "moving" variables in ONLY the bottom if block (if not Robot.moving) to "moved" without changing all of the other "moving" variables in the file. Do you know how this can be done?
Python:
class Robot:
moving = False
moved = False
right = False
left = False
up = False
down = False
x = 0
y = 0
if Robot.moving:
if Robot.right:
Robot.x += 1
Robot.moving = False
elif Robot.left:
Robot.x -= 1
Robot.moving = False
if Robot.up:
Robot.y -= 1
Robot.moving = False
elif Robot.down:
Robot.y += 1
Robot.moving = False
if not Robot.moving:
if Robot.right:
Robot.moving = True
elif Robot.left:
Robot.moving = True
if Robot.up:
Robot.moving = True
elif Robot.down:
Robot.moving = True
Now keep in mind, I know this code doesnt make any sense at all. Its just something I typed up really quick to make an example. So what I want to do is quickly rename all of the "moving" variables in ONLY the bottom if block (if not Robot.moving) to "moved" without changing all of the other "moving" variables in the file. Do you know how this can be done?