 Hello, everyone. Thank you for having me in this beautiful city of Edinburgh. So no matter what you're building with Python, whether it's web applications, simple scripts, or even machine learning models, your choice of editor is one of the most important decisions you can make for your personal productivity. And today, developers are choosing Visual Studio Code as the number one choice on the most recent Stack Overflow developer survey. And for a variety of reasons, because it's fast, it's lightweight, it's free, it's cross-platform, and has great support for multiple languages. So I'm the program manager for our Python developer tools at Microsoft, and I'm here to talk to you about how you can make the most out of using Visual Studio Code for Python. No matter if you've used it already for Python, used it for other languages, or never even heard of it before, I guarantee you'll learn something useful in today's session. So first of all, for those of you who are new to VS Code, what is VS Code? So it is a free cross-platform and open source code editor from Microsoft. It's fast, and it's lightweight. You can just open any folder and start working with various files. It has a very rich extension ecosystem provided by the community, partially because it's actually one of the largest open source projects on GitHub. There's a very active community. It's got very good built-in support for JavaScript and TypeScript, including rich features like IntelliSense debugging and source control, among other things. And I mentioned the rich extension ecosystem. The part that my team builds is the Python extension. And with the Python extension, you get those same rich capabilities for Python. So with the Python extension, you get IntelliSense, debugging, linting, testing, and refactoring. And because of the work that we're doing, Python is actually the fastest growing language in Visual Studio Code, and it's the most popular extension for Visual Studio Code on the VS Code Marketplace. This extension is fully open source, and it was actually originally created by a member of our community, Don Jayimani, from Australia, who's sitting here in the front row. Give a wave to everyone, Don. Thank you. So we love the work that Don was doing, and we hired him on and put a full team on the Python extension. We first published it as Microsoft in November, and we've been putting out a new release with updated features and better capabilities every single month since then. And so I want to call out a few other key extensions that I want to make you aware of before I dive in. If you're coming from other code editors, I hear a lot of people struggle to change their keyboard shortcuts. So there are great keyboard binding shortcuts for VIM, Sublime Text, Emacs, and the IntelliJ Suite of Products. So if you're using other editors, you can install those extensions to make the transition easier. And specifically for Python developers, there's extensions that add Django template syntax and Django snippets, as well as JINJA template syntax and Flask snippets. I'm not going to show these today, but I just wanted to call them out before we dive in. So for the rest of the talk, I'm going to do a whirlwind tour of the Python extension and Python development in VS Code. We're going to start with the essentials, setting it up, selecting your Python interpreter, adding and running code, and configuring things like linting and refactoring. Then we'll go into some more powerful features, like debugging unit testing, tasks, and using Docker extensions. And then some preview capabilities that you can try out today, including IntelliCode, which we just launched here at the EuroPython conference, Visual Studio Live Share, and the new Python language server that we released last week. So without further ado, let's go ahead and dive in and start looking with the essentials of Visual Studio code. So if you want to get started with Visual Studio code, simply go to code.visualstudio.com and click on the bright green download square. You can hit that. And one thing, while it downloads, it's a very quick download. You get taken right to the Getting Started documentation. This is great documentation. I definitely recommend reading it. And for Python developers, you want to move your mouse over to that little Python link over there and click on the Python tutorial, which this Python tutorial takes you through all the basics of getting set up. So if you're very new to it, I definitely recommend going through that tutorial. You'll learn all the basic features that you need to get going. So after you download Visual Studio code, you'll be taken to a welcome screen that looks something like this. And as I mentioned before, you need to install the Python extension. Luckily, we've made that easy. We've got the Python link, which is right there. And you can just simply click on that to install the Python extension. And it will download and reload after you click OK. If you don't like bright blue links, you can also go to the Extensions tab in Visual Studio code, where you can search for Python. And you can go to the Python extension right there and install it. Another quick thing to call out about this page here is that we've got a really good quick start set of steps for getting started. And then at the bottom of that is a link to our Python tutorial. If you're not sure where to find it, it's right there built in. OK, so one of the first things I like to do after installing Visual Studio code is to put VS code on the path so that I can load it from the command line. This happens automatically if you install it on Windows. But if you're on Mac or Linux, you need to run a command. Now to run a command with Visual Studio code, you press Command Shift P or Control Shift P to bring up the command palette, where you have all the commands available to you in VS code. In our case, we want to type shell and run the install code command in path. That will allow us to open VS code from the command line, which I'll show now. So let's create a basic application here with VS code. To do this, I usually start by, from the command line, creating a new folder. I will call it makedoor new app. And then we'll go into that folder. And then because I put it on the command line, I can just type code dot. And that will open up VS code in this folder. Now you don't need to do that. You can also just click the Open Folder button here or do File Open Folder. But I find it very convenient to launch it from the command line. So building our first app here, I like to just click the new File button. And we'll call this hello.py. Press Enter. It immediately gets recognized as a Python file. You can tell that when you see the Python interpreter listed in the bottom left-hand corner. Quick tip, you can click on that interpreter to change to Python 3 or Anaconda or any other interpreter that you have installed. So we can select that interpreter there. And we can say print, hello, EuroPython and command s to save. And then to run this, we can simply right click and say, run the Python file in the terminal. And then the built-in terminal will pop up and run that file. So that was a quick tour of getting started. Just to recap, we downloaded from code.visualstudio.com. We added code to the path, installed the Python extension, created a file, and ran it in the terminal. Now let's do a little bit more scripting with Python. And I mentioned the Stack Overflow Developer Survey earlier. So one of the things that I like to do as a demo is actually download the Stack Overflow Survey data and play with it to poke around in some of the results. So I'm going to create a new file called stackoverflow.py. And to use the Stack Overflow Survey, I'm going to use the requests library to download the Stack Overflow Survey. And so I need to install that. But instead of installing that in my global Python interpreter, I'm going to create a virtual environment. Some people get scared by virtual environments. It's a simple and useful concept. It basically creates a local copy of the Python interpreter that's local to your application so I can install packages without affecting the other applications that I have installed on my machine. So I'll use the built-in terminal here. And I'll run Python 3-m. And that will invoke the VNV module to create a virtual environment. And I'll pass it the argument NV, which will put that into a folder named NV. So Python 3 just guarantees that I run Python 3 if there's multiple Python inversions installed, which there are. And you can see that virtual environment was created here in the VS Code File Explorer. I can see that this is simply just sim links to the Python interpreter and a local copy of the site packages folder that I have here. So I can activate this environment by typing source and then activate. That'll activate that virtual environment for me. Now if I say which Python 3, you'll see that when I run Python, it runs out of this local copy in this folder here. You don't need to activate the virtual environment with VS Code. You can actually have VS Code activate it for you. But first, I need to reload VS Code with command shift P. I'll select Reload Window just so it picks up that new environment that I've put in this folder. And so now when I click on this interpreter in the bottom left-hand corner, that virtual environment will be available from this virtual environment list. So I select that VM there. This time, I'm going to pay attention to this pilot installation warning here. So I'll install linting tools there. So after I've activated that virtual environment, now VS Code uses this interpreter for all the commands it runs. So it installed pylint into this virtual environment. If you want to create a terminal that has this environment activated, you run command shift P and say Python create terminal. And so that will activate that interpreter automatically. So again, if I say which Python, it's running out of that folder. So now I can pip install the requests library from this command line there. And so now I can start using it in code. So to do that, we'll type import requests. Now I mentioned I want to download the survey. So I'll create a new request and say requests.get. And I need the survey URL. So I'll go to the website where they've published all these results. These are fascinating data sets to look at, by the way. They have all sorts of interesting insights into what developers are doing. And so we paste that URL. And then we say with open, we'll save that into a zip file called survey2017.zip. We'll open this as a writable file as file. And then we'll say file.write. You notice I get this in tele-sense as I'm typing here in code request.content. And we'll go ahead and right click and run this piece of code in the terminal again. This time it runs with the virtual environment that we have selected in the bottom left-hand corner. And it will download this as a zip file into my local folder. Great. Now I want to unpack this zip file. And I'm going to write a bunch of code that takes the CSV file out of the zip file so I can start using it. But instead of making you watch me type everything here, they've advised us against doing too much live coding here at the conference, I'm going to use a feature called snippets in VS Code. So I've predefined a bunch of snippets that I have. And I have one called SO extract. And it's available in my snippets list. And when I press Enter, the inserts that code snippet for me. And it pre-selects the Survey 2017 field here, which I've defined as a parameter to the snippet. So I can say my survey. And I can make that a customizable snippet that I can type. And if there's multiple of those, you can tab between all of them. So now I want to run just this piece of code here that I've typed into VS Code. I don't want to run the first part. So I don't want to run the whole file. So I can run just the selected piece by right clicking and saying, run selection or line in Python terminal. Or I can just press Shift Enter, which will activate that Python interpreter, paste it into the command. And you see that zip file was replaced with the CSV file containing the survey results. Another cool thing you can do with snippets is you can put variables in there. So I have a to do snippet that when I type to do, it puts the current date. And I can leave a message for myself that says refactor this code. And just a quick look at how you actually edit snippets. To go edit snippets, you go file or on Windows it's file. But here it's code preferences, user snippets. We select the Python snippets. And here's where we've defined that extract file snippets. It was very easy to put a variable in. You put just this dollar sign 0. And this provides the default value. So one final thing to wrap this up. I left a to do here to refactor this code. So let's go ahead and do that. So I will select this whole block of code, right click, and say extract method. It's going to prompt me to install the rope library. And I'll select yes. So we use the rope package for refactoring. So I'll right click again after that's installed and say extract method. So to find the method name is download underscore survey. And there we go. It's done that refactoring. So just a quick recap. We selected our interpreter. We ran the file in terminal. Oh, I missed linting here. So I have pilot turned on by default. But you notice there's not very many warnings inside of this piece of code. That's because we have a default set of linter rules. It's very non-aggressive. The default pilot warnings contain a lot of style information. So if you want to customize your code style for your team, one cool thing you can do is just check in a pilot RC file. So simply by having the presence of a pilot RC file, we throw away our default pilot rules here. So if I go back and un-tab this, you'll see it'll give me some warnings here. It doesn't like the names of my variables and all sorts of stuff like that. If I want to customize those warnings, I can just put a block in the pilot RC file that says messages control. And just a quick tip on how to do this. It's very difficult to find the syntax for this online. But you put disable equals all, and then say enable equals just the categories. So you can say warnings, convention, or errors. In this case, I just want errors. And you can put individual pilot codes, which you can look up online there. So if I go back to the file, and now it just gives me the error, and it's telling me that this download survey method is undefined. Great. So there's some information on using virtual environments. Very useful. Another thing you can do with virtual environments is you can a lot of people check in a requirements.txt file into their repo. So this enables you to easily package up the dependencies that your Python code has. So you can pip install dash r, a requirements.txt file. And you can generate one of those files using the pip freeze command. And that puts the currently installed packages into that file. And when you're done, you can type deactivate from the terminal. We also have support for pyend, pipend, and content environments in VS code. So if you're using those, we support those as well. And they'll just show up in that interpreter list that I brought up earlier. All right, so let's jump into a few more powerful features of VS code. And for this, I'm going to go through debugging unit testing and some tasks and a few keyboard shortcuts. So I've got this CSV file. I actually want to analyze some of the data in the CSV file. I'm going to jump to some code where I've actually pulled out some of the information and done some analysis. So I've got this in a folder called hello stack overflow. And just like I did before, I'll change to that folder and type code dot to open it up. You'll see that the folder comes right up. And I've got all my Python files here. So just some quick keyboard shortcut tips. I press Command P. That allows me to quickly switch between all the files in my current workspace. I can switch to the stack overflow dot py file. By the way, if you press Alt and press Enter, it'll actually open one of those files in the right-hand vertical tab window. So that's a neat tip if you want to quickly peak into another file. You can also do that just by clicking this button here. Another tip here if you want to split your editor vertically is you press the Alt key. And it changes that little icon from a horizontal split to a vertical split. So I can split the editor vertically there. And we can go on and so on and so forth in a recursive manner. Another quick tip if you want to open the terminal, it's Control-BackTick. That will open that terminal up. And you can also split the terminal so you can split the terminal right. So if you want to do something like have the Zen of Python up on your screen down in the terminal, you can have a dedicated terminal window for that. Although in the Lightning Talk on Wednesday, they advised against reading the Zen of Python too seriously. You can also put your terminal on the right-hand side of your windows if you want, which works better if you're not projecting at a conference. But I find that very useful on larger monitors. OK, so let's get back to our previous configuration. I seem to have gotten myself into a bind here with these terminal windows. Let's just close everything. Put that back on the bottom. OK, so some other shortcuts here. Command-Shift-O lets me open various symbols that I have in the workspace. So you can see as I'm going through this list, I can look at the different methods that I have. So I've basically refactored my previous code example to download all years of the Stack Overflow Developer Surveys back to 2011. There's a method here which does some analysis of those Stack Overflow Surveys called Download Survey. So I can press Enter to look at that. You can also command-click on a method if you want to go to definition on a method. So for example, if I want to look at the request.get implementation, I can command-click, and that will open that file directly there. And another quick tip is you can right-click and say peek definition if you want to quickly look at the definition of that method in line. OK, so aside from just reading the code, let's actually debug this and step through and see how it works. So to use the debugger, it's actually very simple. You just click in the gutter and select put a break point there that will have VS Code stop on this line when we start the debugger. And go to the Debug tab and press the Bright Green Play button. Another keyboard shortcut for play is just F5. So I can press F5 here. And it will actually let me pick my choice of debuggers. This is because we have the next version over Debugger available as an experimental version. It's much faster. It's based on an open-source debug engine called PyDevD. And so this is going to become the default soon. So let's go ahead and use that Python experimental version. And we'll run, and we'll stop at that break point. So this just debugs the current file, whatever Python file I'm at. If I want to debug it, just press F5. So now that I'm stopped at this break point, I can see the variables in the left-hand side of the window here. I can see the year and various things like that. And this analyzes one year of survey for every iteration of this for loop. So if I want to run one iteration of this for loop, I can click the Play button here, the Continue button, or F5, that will run and that will stop after it's downloaded one year of the Stack Overflow Developer Surveys. So if we want to actually look at how this code works, we can use the Step Into button or F11. So we can step into that code here. And we can press Step Over to run over at one line at a time. So that line downloaded the survey. And then we actually, here on this line, we crack open the Survey CSV file. We load it into a pandas data frame using a pandas library, which, if you're not familiar, is a very popular library for data analysis and data frames. So we step over that line, we load the survey. And if we actually look at some of the columns that are in this CSV file, we can type an expression into the watch window, for example, like data.columns. If you look at this, it contains a lot of internal information from pandas data frames. So if we want, we can customize this expression here and say list data.columns. So we can just cast it into a list to get rid of all of the other items. And then we just get a list of columns that are inside of this data frame. This is a little bit, this is not the best window to view this information. So I'm going to switch over to the debug console here by clicking this dot, dot, dot, go to the debug console. I can also type expressions in here. So if I type list data.columns, I can view that here in the output window. And I can see all of the questions that were present on the Stack Overflow survey for this year. You can see the one we're interested in is the which languages are you proficient in, which are people telling us which programming languages that they use. And so as we step through our code, we want to extract just this question plus the related columns that come after it. So we can step over this one line at a time. And we're just iterating through all the columns in the list until we find the right question. I don't want to sit here and step through all the items in the for loop. So I'm going to skip past all of this by using a run to cursor function. So I could set a breakpoint down here and run to that breakpoint. But I can also right click and say run to cursor, which is kind of like a one-time breakpoint. As soon as you hit it, the breakpoint disappears. If you actually looked closely, you'd see a breakpoint briefly appeared there in the editor. So that skips all of that looping. And now we can, again, look at the languages.columns. Basically, what we did was we extracted the languages into a languages data frame. And we can see that if we look at languages.columns in the debug console. And we can see that this data frame just has this information in it. We can also see that there's a total of 2,300 people who answered the survey in this year. So that's pretty neat. All right, let's pop out using this step out function. We'll pop back up the stack to that outer for loop. And we'll let it run to completion. Now, I don't want to download all of the surveys with you guys watching me on the poor Wi-Fi here in this hall. So I'm going to use a task that I have defined that pre-copies cached versions of these files into my workspace. To do that, I'll go to the Tasks window. And I'll say run task. We'll select these custom shell commands that I've defined. One of them is copy cached surveys. And when I run that, the CSV files magically appear. So I can automate some of the things that I do in my day-to-day environment with those custom tasks. And then we'll just let this run to completion and let it generate the results of these surveys. It'll put that out in the JSON file. So if you want to define your tasks, simply go to the Tasks, Configure Tasks window. And you can see that it's as simple as putting shell commands. This also has integration with NPM. So if you have NPM tasks here, they'll show up in this list. OK, so that data is now available in a JSON file where I can see for every year how many people indicated using each language. We can see that Python was used by 575 people on the 2011 Stack Overflow survey. That's pretty neat. We'll take a look at this in a second. But how do we know that this data here is correct? Well, we run unit tests, hopefully. So I've got some unit tests defined in this. I was hoping someone would shout out the answer. We've got unit tests defined here in this test folder. So Visual Studio Code has integration with unit tests. If we want to configure those, we're using the unit test framework, but we support multiple testing frameworks. So to configure those, again, we run a command, command shift P, discover unit tests. That will prompt us to enable and configure a unit test framework. So we just click that bright blue button there. And so we can configure unit test, pi test, or nos unit tests. We'll go with the unit test framework. It will ask us a series of questions, like, where is our tests folder? So our tests are defined in this tests folder here. And the file convention that we use is test underscore star dot py. So we'll select that. And a really neat feature that we have with VS Code is we have these unit testing code lenses. So this lets us run one test at a time. I can run just the test for the 2017 survey, or I can click the run test on the entire class. So I can run an entire class of tests. Of course, you can run all of the tests in your workspace. But after you run the test, what's really neat is that these indicators actually show you little check marks and Xs when the tests pass or fail. We're not going to worry about fixing this unit test right now. We'll come back to that later. But it looks like our 2017 data is correct, but our 2015 data is a little bit off. OK, so just a quick recap. We just went through debugging, start debugging, stepping, inspecting variables, using the debug console, typing expressions in, using run to cursor to run to a particular line of code, keyboard shortcuts for jumping to files, various symbols, and going to definition, configuring unit testing, and tasks within your workspace. Now we're going to do a little bit of web development. We'll show you how you set up more advanced debug configurations for Flask and Django, as well as using the Docker extension. So this data is currently in a CSV file. I'd like to render this in a nice web page. To do that, I'm going to start writing a web application. I'm going to put my web application in a folder called app. So here's a neat productivity tip. If you create a new file and you just type a folder name that you want to put that file into, in this case, I want to put a file in app called main.py. If you press Enter, it'll go ahead and create that folder and put the file within the folder. So I've got another snippet here that'll create a basic Flask web application. It's called FlaskApp. So that's something I've defined. So this gives me just the general boilerplate for creating a Flask application. And what it does is simply import the Flask object from the Flask module, creates an app object, and then defines a home page route which returns some index.html. So I need to create this index.html file. Let me do that again. I'll put that in a templates folder, index.html. And a really cool built-in feature VS Code. We have integration with Emmet. So if you can type the exclamation mark here and press Enter, that will generate an HTML boilerplate template for you, including all of the tags that you need for it to render correctly on mobile devices. I don't know why this isn't default for HTML, but it takes me a long time to find this. So it's built right here into VS Code. And then we can just start editing our HTML file. OK, so I'm going to switch over to a version of this. Ooh, an update to Docker is available. Let's skip it for now. I'm going to switch over to a version of this code that has a little bit more HTML written for me. It's called Stack Overflow Flask. I'll run code dot here. And we'll just take a quick look at what's in this code. In that main.py, I have an API that returns the data file that we just generated from that Stack Overflow Survey analysis. And the index.html renders that data with some pretty charts. So if we want to run this file here, just a quick tip. You can right-click on that file and say Run Python File in Terminal. That will, again, activate the virtual environment and run that on localhost. But I'm going to actually run this inside of Debugger. So no matter where I am in my workspace, when I'm working on a web application, I always wanted to start the main.py file. So to configure that, I can go to the Debug tab and I can add a debug configuration by clicking on this little Settings Gear link or this Add Configuration button here. So let's add a configuration. Again, we're going to use the experimental Debugger because that's going to be the default one soon. And it adds a default set of configurations here. We have Debug configurations for Flask and Django. And one of the reasons that you want to do this is it lets you set your entry point. In our case, our entry point is in the app slash main.py file. But it also turns on JINJA template debugging or Django template debugging for these types of apps. So that's a feature that we do support in VS Code for web developers. So once I've got these different configurations defined, I can pick which one I want. So I can continue debugging the current file if I use the current file configuration or I can use the Flask configuration if I want it to launch my Flask application. So we'll click Play there. And that will start our Flask application. And this time, let's browse to the URL. A little quick tip here. If you have a URL or any file link in your terminal, you can press Command-click to open that link. And it opened the browser, and then I hit the break point right away. So we'll just switch back here, and we'll let it run. And there's my simple chart of the survey data for the past few years. Python's actually growing super fast, more than 20% year over year, now used by more than 38.8% of developers worldwide. So you guys are all doing great work in this room. OK, so it's very common to use Docker containers. I was told that Docker was actually launched at PyCon. So Docker is a very popular technology used by Python developers. So let's go ahead and throw this into a Docker container. So to do that, I'm going to install the Docker extension into VS Code. So we go to the Extensions tab, go to the Marketplace, search for Docker. And we install that. I have it disabled in my install, so I don't have to download this live on stage. But I'll just click Enable There. And after we install that extension, you have to click Reload. So now that this extension is installed into my workspace, it adds a few useful commands. So we'll go Command Shift P to open the command palette. And the first command we'll use is the Add Docker files to workspace commands. So if you're new to Docker, this is very helpful. It puts some predefined Docker files in there for you for different languages. We've got Python, Go, Java, Node.js, and Ruby, and .NET Core. So we'll use a Python template here for our Docker file. And then it also asks which app we want, which port we want our app to listen on. We'll go with the default port 3000. And that just puts in some of the useful Docker files that we need. And in particular, let's go ahead and take a look at the Docker file and customize this a little bit. So some of the features that you get after these Docker files have been created is that the Docker extension adds completions for the Docker base images. So I want to actually use a different base image that loads a Flask web server. And so I'm going to change this here. There's one great image out there created by a Docker Hub user, Tiangelo. And you can see I get auto-completion. So these are loading the images that are available on Docker Hub for me. So I'm going to select this Nginx Flask one, because I want to host Flask in an Nginx web server so that it's nice and fast and production-ready. And I can pick, I get auto-completion for the various tags that are available. So I can easily pick the Python version that I want to run here. So I pick Python 3.6 running in Alpine. Alpine is a very small version of Debian. It's really good for production. Smaller images make everything faster in the entire build tool chain and running at runtime as well. And I'm just going to configure this image a little bit. I'm going to set the listen port. This is a configuration variable for that specific to this image that tells Flask to listen on port 3,000 so that it matches the exposed port there. I'll copy the app folder into the app folder within the Docker container. And then I'm going to comment out these lines here because the Docker container already has this base image, already has these commands that install Python packages. We also have commands built in. If you're using pip-bemv or conda, you can uncomment these versions. That'll help you get your conda environments installed or pip-bemv environments or packages installed there easily. So now that I've set up my Docker file, I can run another command called Docker compose up, which will build this image here. And it will actually start it locally running on port 3,000 because that's what's been defined in this Docker compose file here. And after I do that, I can go to the Docker tab. And here in the Docker tab, I can see all the images that are available on my machine. I can delete, manage them, and I can see the Docker container here as running. A really neat thing, I can stop, restart, remove this container, attach a shell, and I can also show logs. So just to prove that we're running locally here, I'm going to use that same control command click. And there is the app running inside of a Docker container that I've just created using VS Code. All right, so now we're on to some exciting new preview features that we've just announced. Now, these are things that you can try today, but they're in beta, so we're still learning and experimenting and fixing bugs in some of these. The first of which I mentioned Visual Studio and Telecode, which we've launched here at EuroPython and launching at 7 AM UK time really was interesting from a perspective of having your entire team up at 11 PM on the US West Coast. So that was fun, but we're very proud to announce this. This is machine learning-based auto completions for Python code. And this is based on training on more than 2,000 public and high quality open source repos that infers that sorts the completion list based on your current code context. And let me go ahead and show you exactly what I mean by that. So if I switch over to a different repo that I have here called IntelliSense Samples, we'll open this up in VS Code. So IntelliCode is a separate extension that you can install if we go to the Extensions tab, type IntelliCode, you got this Wi-Fi. We'll install that IntelliCode extension, and that's going to, after I reload VS Code, we'll take a look at some various code samples here. So the first thing it does is that actually prompts you to install the Microsoft Python language server. This is a new IntelliSense engine that we've just released last week. So it's a preview, so it's something you do have to opt into. But when we turn that IntelliSense engine on, IntelliCode is able to use that new IntelliSense engine to power some of its results. So let's take a look at a few examples of what this means. So normally when you're getting completions on things like the file operator, there's about 100 items in this list, but the IntelliCode machine learning model has learned and said that these are the most likely options here that are asterisked. So it suggests using file.write. So I can do that and say file.close is another suggestion that comes up. And this works great for the system modules. If you import OS and type OS. It suggests common things like OS.path, get current working directory. If you import sys and type sys. You get argv and path and standard out and some various things like that. And this works on a broad variety of applications that we've trained the model on. So if we go back to our Flask application and we use the app variable, it pulls up app.route as the top of the list here. And we'll go ahead and fill in this code here. And then within the actual method, if I use app.again, it actually gives me different results because it knows I'm inside of that route method there. So here it's now suggesting config and send static file. Send static file is the one that we want. And let's quickly switch over to another code example where we do a little bit of machine learning code here. This is the TensorFlow Getting Started code from the TensorFlow website. So I'm just gonna follow along with the code samples here. If I do tf.it brings variable to the top of the list. Finish typing this code here. So float32, that's also in the suggestion list. And if I come down here and use tf.again, now it's giving me tf.placeholder as the top item in the list. And tf.now it's suggesting float32. So as I'm working through different sections of this code, it's giving me better and better suggestions. And my favorite example here is if I do tf.at the bottom, it suggests the global variables initializer, which is at the top of the list. And then right after that, if I use create a TensorFlow session, it suggests session variable. So one of the benefits also, if you've noticed with the Microsoft Python language servers, as I type, I actually get syntax errors live in code. So if I put things like semicolons in, it flags those right away as different issues. And in general, I get much richer intelligence here provided by the open source typeshed definition files. So that's another benefit of the language server. Okay, so that's IntelliCode. I encourage you to try it out today. Personally, I really miss it when I have the extension turned off. So it definitely improves my personal productivity. And the other thing I mentioned was the Microsoft Python language server. IntelliCode turns us on by default, but if you wanna use just the language server, you can turn that on by going to your preferences and settings and setting the python.jedi enabled to false. And one final demo that I'll share with you, another preview feature is Visual Studio Live Share. This is an extension for Visual Studio Code that allows you to do real-time collaborative editing and debugging with VS Code. And for this part of the demo, I'm gonna go back to that unit test that I had that was failing, and I'm going to get a more proficient developer to help me solve that unit test. And in fact, I'm gonna ask Don to help me code that live with me sitting from the front row right in front of us. Okay, so let's go back to that repo that we had earlier. I'm gonna get back to the code example where I had that failing unit test. Okay, so this was that failing unit test here. Give it a quick run. And so while that's running, I'm gonna install the VS Live Share extension. So if you install this extension, you just have to sign in. You can sign in with a Microsoft account or a GitHub account, and then you can easily generate a sharing link from your workspace. So this share button has now appeared on the bottom of my window. And if I click it, it's gonna copy a sharing link to the clipboard, and then I can go and chat and say, Don, please help. And so Don can just go click that link and that will actually stream all the files from my workspace over to him. And just for a quick idea of what this looks like on his side, I have a video recorded where this link pops up and he can click on that link that opens the collaboration session on his machine. And just by clicking that link, it'll open up VS Code on his side. And it actually streams all the files into a Visual Studio Live Share workspace. So he doesn't need to have a copy of the code and he can actually go and look at the code and he gets all the IntelliSense and features like that working. So now that I see Don's joined my collaborative session, I can actually see where Don's cursor is. This is Don right here in this little yellow link. Don, why don't you go ahead and take a look around in code? So he's gone and looked at some other file here. And I can follow him by clicking this little button here and say follow Don Jayamani. And so he's scrolling around and looking at the code. He can highlight text and look at interesting things. And no hands over here. So he's seeing some interesting stuff. He's getting familiar. I can actually go off and look at different code than he's looking at so we can get a good sense of the code base. We can also do some collaborative debugging. So I'm gonna start debugging this unit test that I have that's failing. And we're gonna land right at that breakpoint that I've just set there. So let's give us a second. All right, so Don can actually now control the debugger. So he can step through code. He can step down into that method and he can go down to the bottom here and he can actually see if he can fix this unit test for us. So he set a breakpoint there. He says this looks interesting and if you put a blank line here. So he's put a piece of code in there which I can then take and if we rerun our unit test quickly here we'll see that he's now fixed our unit test for us. There we go. Thanks Don for fixing my bug. So that was VS LiveShare. Get the VS LiveShare extension and start doing pair programming and code reviews with your coworkers. And that concludes all of the tips and tricks and features in this talk. You can get productive with VS code today just go to code.visualstudio.com and for more information about what we're doing with the VS code extension or anything for Python and Microsoft including Python and Visual Studio and Python and Azure check out our Python blog. Codes and slides are available up here at this repo and follow us on Twitter. Thank you so much for having me here. This is just a wonderful conference and I really love this city. Thank you.