0

Is the a shortcut to execute multiple lines of code, without having to move the cursor to the last line? For example after changing something in the middle of the code block and not wanting to use the arrows-key to go to the end.

2
  • What do you mean by "move the cursor to the last line"? Are you, perhaps, using IDLE? You cannot normally "change something in the middle of the code block" in the command-line interpreter (python.exe); pressing the up arrow doesn't move the cursor to a previous line, but instead (typically) replicates a previous line on the current one. Commented Nov 5, 2021 at 13:57
  • You are absolutely right! I am using the PyCharm IDE. I will update the question.
    – LC117
    Commented Nov 5, 2021 at 14:02

1 Answer 1

1

You can press ctrl+end to go to the end of the python multiline script, and then hit enter (if you are in an indentation block such as editing a for loop, first delete the indentation with backspace, then enter). A more specific shortcut for that operation would be too much of a whim, nobody would need it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.