[Python] VSCode: navigate from exception to the code that caused it in interactive python...

Discussão em 'Python' iniciado por Stack, Julho 30, 2025.

  1. Stack

    Stack Membro Participativo

    My understanding is that the "Interactive Window" is the supported/best practice way to do REPL in VSCode. So I click the "Run or Debug" menu from my Python file and select "Run current file in interactive window". If an exception occurs I get the usual trace in the interactive window. The line(s) that caused the exception are displayed as links, but clicking a link takes me to the prompt in the interactive window, not to that place in the code.

    How can I easily navigate to the line of code that caused the error in order to fix it?

    It seems I should be able to click the blue "line 90" or "90" links in the below image and be taken directly there in the editor to fix the typo. Instead I'm taken to the "press enter to execute" box. [​IMG]

    Continue reading...

Compartilhe esta Página