Welcome back.
The next code editor we're going to look at is a very, very popular one.
It's completely free.
So I think right now it's probably the most popular code editor out there in the community, and I think
you'll see why.
We can download it based on your machine so you can pick whatever computer you have.
In my case will download it for Mac and it has a really, really good get started guide.
Again, all these tools have a lot of information online for them.
So again, if you get stuck with downloads, there's always a way for you to figure out how to solve
these.
Now keep in mind with code editors, it doesn't just mean these are for Python.
Both Sublime text and Visual Studio code can write any sort of language programming language that you
want.
Like myself, I usually like writing JavaScript as well, so I can go back and forth between different
languages but still use the same tools.
So let's open up vs code.
We're going to install this and again on Windows will be very similar.
You'll go through an installer in my case I'll add it to my applications.
My case should appear somewhere around here.
Click on that.
And there you go.
We have Visual Studio code.
There's a lot more going on than sublime text.
It's why I actually prefer sublime text to just less things happening on the screen.
But you can see over here that has some really nice features.
For example, we can create a new file here and we can just create, let's say, a python file.
So I'm going to command se and save and just call it.
Hello dot py because we want to create a python file.
You'll see right away.
When I do that, it's going to tell me.
Hey.
There's no Python interpreter selected.
You need to select a Python interpreter.
And luckily we actually learned what that means.
Right?
So let's select a Python interpreter and look at that.
It tells me that I have a choice because we've downloaded version 3.7.
But on my Mac I also have the pre installed 2.7.
So luckily Visual Studio code tells me, hey, which one do you want to use?
And I'm going to say I want to use Python three.
There you go.
And I get another hint, it says, Hey, we also have a winter available for Python.
Do you want to install that extension as well?
We'll get to that in a bit.
But for now, let's focus on this if I do print.
Hello.
Getting really creative with my code here.
You see that again?
I have syntax highlighting.
Everything looks good.
If I miss a bracket, what happens?
Do I get any errors?
What if I just write some gibberish here?
Hmm.
I'm not getting anything because.
Well, I don't have this pilot installed.
But again, we'll get to lending in a bit.
The cool thing about Visual Studio code is that you also have the terminal right here.
You can actually, if this isn't open for you, you can just click terminal.
And just say new terminal.
Now in here.
I'm going to close this for now.
I can run my python code.
And let's make sure it's just a print.
I can say Python.
Hello, dot pie.
If I click Run.
Hope I didn't save this.
I'll make sure I save it.
So it's the new version.
And run this again.
Python.
Hello, dot pie.
Look at that.
It's all working.
Now, up to this point, we have this print.
Hello.
We also know that we're running Python version 3.7.
You can see here, if I click on here, I can select what interpreter I want to use.
And it also gives us a few tips such as, Hey, Lynch, your pilot is not installed, so let's install
pilot.
Pilot is a launcher that is it's almost as a spell checker for our code.
Letting us know is the syntax right.
And there are many versions of winters available for Python pilot just happens to be one of the most
popular and Eve's code by default suggests Python.
So let's install that.
Once that's installed, you see over here that everything is going through.
And now let's see if this works.
So let's save this file.
I'm going to say file, save.
And if I click on problems here.
Hmm.
There are no problems detected so far, but we know that the print should have brackets around it.
So what we want to do here is go to view command palette.
And we see right away that it says Python enabled lending.
If I type python here.
The Python installer that we had at the beginning when we installed VS code, installed a whole bunch
of shortcuts and tools for us to use such as enable lending.
So let's click on that and I'm going to say on if I save.
Look at that in my problems.
It says missing parentheses in call to print.
Did you meet?
Did you mean print?
Hello.
I also get this little underline and it tells me exactly a what print does, but also tells me what
errors I need to fix.
And you see that it's a pilot syntax error.
So again, I can just fix that nice and easy.
And now if I save, there's no problems.
Everything is running fine if I go to my terminal and do python.
Hello?
PY.
Look at that.
Everything is working nicely.
So this problems panel is really nice for your code to be told, Hey, something's wrong.
For example, if I miss a bracket here and I save.
The problems is going to tell me, hey, hey, there's something going on.
There's a syntax error, and pilot is helping me solve that issue.
By the way, you might be asking yourself, how come my editor vs code doesn't look like this?
For example, if I go to extensions, I have the Dracula official theme enabled now.
Which is a color theme that I have for Visual Studio code.
And let's click on this over here and just and just say disable all installed extensions.
You'll see that I just have a few extensions that allow my Visual Studio code to be customized.
But in your case, if you're just installing Visual Studio code, it will look something like this.
But by installing the Python package with the pilot, we now have a fully abled IDE in a sense for us
to write Python code.
I'll see you in the next one.
Bye bye.