vscode-code-runner

VSCode: The term 'python' is not recognized…but py works

时光总嘲笑我的痴心妄想 提交于 2020-12-04 18:32:02
问题 I just installed python on VS Code and I can't run any python code using python command. python command: Running the code seems to run python command by default and it does not recognize it. When I right click and choose Run Code it complains: 'python' is not recognized as an internal or external command, operable program or batch file Same goes for manually running python main.py . When I open an elevated PowerShell and run python , it complains: python : The term 'python' is not recognized

Vs Code: How can I use the run code command to query my database?

安稳与你 提交于 2020-08-10 19:21:11
问题 In Vs Code there is a play icon on the top right of the window that when clicked runs the code in the opened file. I have a development server opened on my laptop. Can I query my Db with the run code command? For example, I have a file with code as seen below(I am using nodejs and mongodb via mongoose): async function getUsers(){ try{ let Users = await User.find({}) console.log(Users) } catch(err){ console.log(err) } } getUsers() Everytime I run the VsCode run code command I do not see any

Code Runner does not work for Python in VsCode

喜你入骨 提交于 2020-06-29 03:49:13
问题 I can run python files in cmd promt and Vscode terminal (cmd prompt). When I try to run any programme with Code runner ( "code-runner.runInTerminal": false ), I get the following error: [Running] python "c:\Users\MY PATH INCLUDING WHITESPACE\hello_world.py" Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640 Here are the user settings (settings.json) I have tried: "code-runner.executorMap": { "python": "python", }, "code-runner

How do you get the Code Runner extension in Visual Studio Code to use the selected Python interpreter?

喜欢而已 提交于 2020-03-18 10:02:16
问题 I'd like quickly run the active python file in vscode using the Code Runner extension. When I run it I get the message... Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640 I would like Code Runner to use the active vscdode Python Interpreter. How? 回答1: This took some time to find so I thought I'd post the Q & A here for future searchers. From this github post. Open your settings.json file and add this setting. "code-runner

Visual Studio Code Cant get output from a C# code

流过昼夜 提交于 2019-12-24 07:13:05
问题 I'm trying to run a simple Hello World code in VSC 1.13.1. using System; public class Hello1 { public static void Main() { Console.WriteLine("Hello, World!"); } } It successfully completes execution but doesnt produce any output ie - Hello, World! Any help please! Using Code Runner. 回答1: Add Console.ReadKey() , so the output will be there until the key is pressed public static void Main() { Console.WriteLine("Hello, World!"); Console.ReadKey(); } 回答2: There currently seems to be a problem

Why doesn't Console.WriteLine work in Visual Studio Code?

元气小坏坏 提交于 2019-12-21 09:21:21
问题 I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0. Any suggestions? Here's all the code in case anyone is interested: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { Console.WriteLine("Test"); } } 回答1: If you are

Getting error: /bin/sh scriptcs: command not found

与世无争的帅哥 提交于 2019-12-04 11:19:32
问题 I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } When I run it using the play button in the upper right hand corner I get the following error: /bin/sh scriptcs: command not found Then [Done] exited with code=127 in 0.008 seconds The program does not show the desired output. EDIT: Much thanks to @VonC. His

Why doesn't Console.WriteLine work in Visual Studio Code?

徘徊边缘 提交于 2019-12-04 03:07:23
I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0. Any suggestions? Here's all the code in case anyone is interested: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { Console.WriteLine("Test"); } } If you are just trying to run a cs file without a project etc then the problem is that code runner is treating the file

Getting error: /bin/sh scriptcs: command not found

依然范特西╮ 提交于 2019-12-03 06:55:19
I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } When I run it using the play button in the upper right hand corner I get the following error: /bin/sh scriptcs: command not found Then [Done] exited with code=127 in 0.008 seconds The program does not show the desired output. EDIT: Much thanks to @VonC. His approach worked. Pro tip for anyone: install scriptcs using brew install scriptcs Considering the