Code Runner For Python

Is there any keyboard shortcut to run code from Visual Studio Code?
Is there any keyboard shortcut to run code from Visual Studio Code?
Jun-04-2018, 07:33 PM (This post was last modified: Jun-04-2018, 07:46 PM by python300.)
I know you can right click in the editor and select Run Python File in Terminal.
Or I can right click the name of the python file from left panel and select Run Python File in Terminal.
But what i am trying to find is if there is a keyboard shortcut to run the code?
My bad. I was missing code runner extension and so was unable to see the Run triangle symbol at the top of code editor.
Once I installed Code Runner, I can see the Run Code symbol (triangle) and om highlighting it, I see the shortcut Ctrl + Alt + N
Jun-04-2018, 09:39 PM (This post was last modified: Jun-04-2018, 09:39 PM by python300.)
I have installed Visual Studio Code and added extensions - Python, Code Runner.
With Code Runner, now I can see the Run Code symbol (triangle) and on highlighting it, I see the shortcut Ctrl + Alt + N
But when I try to use it to run the code that asks for user input, I can't find a way to provide the input.
When I try to enter user input, I get error message 'Cannot edit in read-only editor'
I think this is because I am missing some configuration part for Code Runner like setting up PATH or some other Workspace settings.
Please assist me in identifying what all configuration will I need to do and how?
[UPDATE]: I did select 'Add Python 3.6 to PATH' while installing Python.
I have attached screenshots for reference.
Note: Even now when I right click and select 'Run Python File in Terminal' for the same program, I can enter user input fine and get the expected output.
Jun-04-2018, 11:35 PM
Install Code Runner,get a button and shortcut Ctrl+Alt+N.
Can also build own task that run Python.
Aug-07-2018, 09:12 PM
Finally I got answer to my second question (which I wanted to post as a new question) from SO.
Answer:
You can provide input by telling code runner to use the terminal.
To do this, there is a setting called code-runner.runInTerminal, set to false by default, that you can set to true.
In the lower left hand corner of the screen on 'VS code' you'll see the icon which will take you to settings when clicked.
Thank you to the helper who answered it there.
I wanted to post that answer here so if someone like me comes here searching for the same thing, he/she will find help here.
Python code runner download

Python Editor

Batteries included. With Python versions 2.7, 3.5, 3.6, 3.7 and 3.8, and all the goodies you normally find in a Python installation, PythonAnywhere is also preconfigured with loads of useful libraries, like NumPy, SciPy, Mechanize, BeautifulSoup, pycrypto, and many others. Build, Run & Share Python code online using online-python's compiler for free. It's one of the quick, robust, powerful online compilers for python language. Don't worry about setting up python environment in your local. Now Run the python code in your favorite browser instantly. Getting started with this Python.


Code Runner For Python

Code Runner Python Input

Possibly Related Threads…
ThreadAuthorRepliesViewsLast Post
Autocompletion for Python in Visual Studiouser34811723Dec-10-2020, 12:03 PM
Last Post: snippsat
Installing the Visual Studio Code on Linux - how to do that!?apollo41,670Oct-05-2019, 09:48 PM
Last Post: apollo
Code runner for python download

Code Runner Python 3

Code

Code Runner For Python Programming

Users browsing this thread: 1 Guest(s)
Runner

Code Runner For Python Download


Comments are closed.