# Running Python Scripts with Code Runner 🏃 ## Installing Code Runner Extension Click the extension icon on the left most stripe and type `code runner` in the search bar. You should see the extension popping up in the first row. Click and install. ![Imgur](https://imgur.com/UitPn9B.png) ## Setting up Code Runner By default, code runner uses its own panel for showing the results after you run your python script. However, it's better to set it up in a way that it will show the results in the integrated terminal. * Press `ctrl+,` to open up the settings panel * On the search bar type `code runner terminal` * You should be able to see an option named `Code-runner: Run In Terminal` * Check off the option and you are good to go 🍰 ![Imgur](https://imgur.com/1a7P3Mc.png) ## Running Python Scripts * Create and select your python environment (See the instructions [here.](https://py-vscode.readthedocs.io/en/latest/files/venv.html)) * Create a new file via `ctrl+N` * Press `ctrl+s` to save the file and give it a name with `.py` extension * Write down your python code in the file * Press `ctrl+alt+N` to run the code via Code Runner * You should see your results in the integrated terminal 🛬 * To run only a selected lines of codes, select the lines you want to run and press `ctrl+alt+N`. ![Imgur](https://imgur.com/oD19vWb.png)