Python Part 2 - Setting up and using Visual Studio Code

Python Part 2 - Setting up and using Visual Studio Code So welcome to this tutorial series on learning python from wiseart training in this tutorial you'll learn about installing and using visual studio code as always you'll be able to click on the.

Little information symbol at the top right of your screen to download files and exercises for the tutorial you're watching but actually there aren't any exercises.

For this particular one but i think that's enough of me speaking it's time to hand over to my electronic avatar electronic andy who will take you.

Through the rest of this tutorial so here's what you'll learn in this tutorial we'll begin by looking at installing visual studio code you won't be able to do much without.

That we'll look at choosing a theme and then we'll look at installing python so you can program in python visual studio code allows you to program in lots of languages.

But they have to be installed we'll look at the terminal window which you can use not only to see the output from programs that you run but also to run single line commands and.

Python Part 2 - Setting up and using Visual Studio Code

Then we'll look at creating file programs just like we did in idle so you can run multiple statements at the same time we'll look at installing the code runner.

Extension to make it easier to run programs and then we'll look at the important topic of how to change your settings in visual studio.

Code and then what i'll do is take you through some suggested settings you might choose to impose and finally we'll have a look at five.

Tips for becoming more productive in visual studio code so let's get started so if you want to be able to use visual studio code on your computer.

You're certainly going to have to install it and here's how to do that so you could run a search for vs code it saves typing and if you click on google search or.

Whatever search engine you're using go to the first result returned almost certainly you'll be looking at the visual studio code website i can click on the drop arrow next to.

    This download button to see possible

    Options i could install it for an apple mac or for linux but i'm going to go for the default option which is a stable build.

    For windows so if i click on that button what it will do is begin the download process and it won't even give me time to tell you a good joke before it finishes on my.

    Machine so there's the executable downloaded and now i can open it and what it will do is run the installation process.

    I can accept the agreement always wonder what happens if you don't put it in the default location and give it the default name i'm going to tick these extra boxes.

    Because i possibly want to be able to double click on the python file to run visual studio code i have to be honest i'm not quite sure of the results of that.

    And then if i click on the next button i can begin the installation process and considering it's a 300 megabyte program it's actually really quick and you can see there it's finished and.

    What i'm going to do now is click on the finish button to launch visual studio code and you can see if i go to my list of programs visual studio code is installed.

    So this is the opening page you see when you go into visual studio code and we're just going to do two quick things the first is to choose a theme there are so many ways to change your theme.

    And later on in this tutorial i'll show you some of the alternatives but for now if you click on browse color themes and it's basically a choice of whether you want to be on the dark side.

    Or the light side

    I want to be on the light side so i'm going to choose light visual studio and this is the theme i'm going to use for the rest of this tutorial series.

    The second thing i was going to show you is how to get it so this well irritating welcome pop-up doesn't appear all the time and to do that you can go to the settings.

    Icon at the bottom left corner of your screen you can click on that and choose to change your settings you can type in startup.

    You can choose from the drop list for the workbench start editor that you want to see nothing the other options would just irritate me i'm afraid but then i'm easily irritated.

    I can then close down this window and also close down the welcome window and this is what i'll see when i go back into visual studio code it will always show you some helpful.

    Shortcuts in the background just to nudge you in the right direction what i want to do now is show how to install python in visual studio code because at the moment it's not actually.

    Available so to do this at the top left of your screen you have something called the activity bar and this.

    Provides a way to do some of the most common tasks in visual studio code the two most interesting things are probably the top icon which allows you to create.

    And open files and folders and the bottom icon which allows you to install extensions and that's exactly what we want to do now so i'll click on it.

    Now normally this list will take a while to appear but because i've already pre-prepared this it should appear almost immediately just zoom in for a second you can see.

    That the most popular program by far is python with 39.9 million downloads but there's 28 816 extensions in total so whatever you want to do in visual studio code with regard to programming.

    The chances are you'll be able to to install python you just click on the install button to the right of it as you might expect and it only takes a few seconds it's.

    Going to install intellisense which will give me the ability to auto complete commands linting i must admit that was a new word for me what it basically means is error.

    Checking and debugging which will allow me to step through my python programs and i clearly haven't been speaking quickly enough because it's already.

    Installed it says it's enabled globally we'll come when we talk about virtual environments in a later part of this tutorial series we'll see the.

    Implications of that you only ask for one thing but you've got three you've got python you've got the pylons which gives you all those extras i was talking about.

    And you've got something called jupiter notebooks which as far as i can see is a bit like notepad so that's how you install python the next thing we're going to do is run a.

    Program and to do that we need to learn about the terminal window in visual studio code so what i want to do now is to run a.

    Command in the terminal window now to bring up the terminal window i think the easiest way is to hold down the control key and press the apostrophe symbol and when.

    You do that it alternately hides and displays the terminal window so you can see that i pressed it to hide it and if i press it again it will display it again.

    There's another key you can press which is shift control and apostrophe and this does something slightly different when i press out it opens up another.

    Instance of the same terminal window so you can see that every time i press it i'm getting on the right hand side here an additional terminal window so what.

    I'm going to do is hover my mouse over the second and third one i created and kill it or delete it so i'm back to the individual single command window.

    To run a command in python what i need to do is first open up the python interpreter and i can do that by typing the command python when i press return you can see.

    Something pythony has happened i can then type in any valid python command i like at the command prompt essentially this is just like idle was in the first part of this tutorial.

    Series so for example if i want to print out the noise now makes why change a good example i can type in nevada python command.

    And press the enter key and it will give me the output of my command when i've finished typing python code i can type exit and open and close brackets and what.

    That will do is close down the python interpreter and take me back to the command window so when i press return you can see i'm back in just the.

    Terminal window so for example i could type in cls to clear the screen it won't work in linux i don't think but it will work in windows.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continue to make videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=bwhTaKu91tY
Previous Post Next Post