Visual Studio Code for Python Developers Transcripts
Chapter: Editing Python Code with VS Code
Lecture: The Default Python Experience

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now for the fun part, let's experience what it's like by default in Visual Studio Code to work with Python.
0:08 And the first thing we're going to do is, one, I'm going to show you that this is the default experience.
0:12 If you just installed VS Code, a fresh install of it, you'll probably have nothing installed.
0:18 I do because I'm using Windows Subsystem for Linux, but that's not for the purposes of this video. We'll skip over that.
0:24 In this case, we don't have anything, right? That's the point. We don't have anything installed extension-wise in Visual Studio Code.
0:30 So we have the raw experience. So I'm going to create a new file. I'm going to call it demo.py.
0:34 And you'll notice that Visual Studio Code realizes that the file extension is Python,
0:40 and therefore the theme that I'm using, the icon theme, is indicating that that is a Python file.
0:46 Now if I start typing out some Python code, like let's print hello world, that seems okay.
0:51 We get a little bit of this syntax highlighting that's going on for things that are a string or a particular keyword in Python. They're in VS Code.
1:01 And that is giving us a little bit of help in here. Let's take it a step further a little bit and try some more keywords in Python. Okay.
1:14 So you can see it's highlighting some of those keywords.
1:16 Again, these statements of from this module, I want to import this particular fun or from this library.
1:22 I want to import this particular function or module and so forth. Right? So we're getting a little bit of highlighting.
1:27 Let me show you what that looks like. If it's even. Not a Python extension file. So let's create a new file.
1:34 I'll demo without any file extension and start writing the same code. So far, no highlighting or anything like that.
1:43 And now VS Code is starting to notice something. It's like, hey, this looks like Python code, even though it doesn't have the Python.py extension.
1:55 And it's recommending you install the Microsoft Python extension for the Python. Language.
2:01 And what this will do is it's going to enhance the experience.
2:04 It's by default, Visual Studio Code doesn't have Python support fully baked in and they abstract that out so that it's an extension and you choose to opt in to have that type of experience within Visual Studio Code.
2:17 So let's skip that for now. Well, in the next video, we'll actually install the Python extension, but I want to show one of the things.
2:23 So if I wanted to run this code right now and Cecil in a later module is going to go through running and debugging Python code and projects.
2:30 In Visual Studio Code. But for the sake of this quick demonstration, I want to show you what the experience is like.
2:35 And let's just do the print hello world. And I get hello world. And that's the raw default experience in Visual Studio Code.
2:45 In the next video, we're going to talk about the Python extension, which is going to enhance this experience and give it a richer environment for us to be working within.
2:52 Understand what that's about and what it provides to Visual Studio Code to create that experience for us.


Talk Python's Mastodon Michael Kennedy's Mastodon