skip to Main Content

I used to use Pyzo for Python coding and decided to give VS Code a try because it is more feature-rich. I came across one huge annoyance, however. In Pyzo, I am used to code „interactively“ as Pyzo executes code in an interactive shell (https://pyzo.org/features.html).

I would like to replicate that in VS Code, but so far had no luck. With the Microsoft Python extension installed, the closest I can come is to select the whole code, right click and then click on „Run Selection/Line in Python Terminal“. For long scripts, however, this is very, very slow as it first prints each line to the terminal and then executes it line by line. Pyzo seems to operate silently.

Do you have a solution? I think, VS Code would be much faster if it did not print each line to the terminal first.

Best

2

Answers


  1. Use Code Runner(extension available in the marketplace of VS Code) or run a bash script in the terminal (python -u [name of the file])

    Login or Signup to reply.
  2. I use Python Interactive window and find it very useful. It is not an immediate REPL but gives you the time to write a block of code and execute it with a key stroke.

    At the bottom of the interactive pane you have a command line where you can type like a REPL. It is a temporary cell (multi line)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search