How to Run Code in Visual Studio Code Easily (2024 Update)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to this video guys in this video I'll show you how you can run code in Visual Studio code for various languages like python PHP JavaScript or any other language that you have so first let's open window Studio code and here I already have this project open with some python code okay so now there are three ways that I'll show you how you can run this code in vs code we can write code and we can edit code and we can do all that stuff very easily but to run the code we will need to have the compiler or interpreter for the specific language installed so if you want to run python code you will need to install python in your system if you want to run PHP you will need to install PHP if you want to run node you will need to install nodejs and similarly for any other programming language sorry if you want to run Java you'll have to install Java now if you already have installed then you can continue but if you don't have the specific language of your choice choice installed in your system check the link in the description I will show you how you can install with various languages now after you've installed if you want to run this one method is to click on Terminal and sorry click on run and click on run without debugging this is faster and it will immediately run your code now as you can see the running is started and the output is now this now if you have some text output like this is uh hello world or something else it will just be printed here in the terminal so for example if I just comment this and I say print hello world and then I run this again as you can see Hello World Is Here printed in the terminal now another method is using debugging now what is the difference between these two the difference is when you do start debugging you can have break points like this here see and the code execution will be paused here you will have to click next and then only these lines will be executed so full tutorial on that is beyond the scope of this video so basically these are the two things now instead of just doing this what you can do is you can press the shortcuts control F5 and F5 so I'll WR I'll press contrl F5 and again it is running without debugging right but one easier option is to click on just this so in your case you might not be seeing this so how can you bring this right so you can have this for any language so to install this you need to go to extensions and search for an extension called Cod Runner and you'll see this with this many installs and this so I already have this that's why it's showing this now you can install this so let me just uninstall this okay and in your case you will see this option so as you can see here that play button is gone so once you install this this play button will appear and you can just click this and your code will be executed so this is how you can run code for specific languages if you have any questions let me know in the comments below
Info
Channel: The Code City
Views: 166
Rating: undefined out of 5
Keywords: how to run code in visual studio code, how to run code in vscode, run code using terminal vscode, visual studio code how to run, how to run programs in vscode, how to run programs in visual studio code
Id: q6IzDasPk48
Channel Id: undefined
Length: 3min 10sec (190 seconds)
Published: Fri Apr 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.