What's your favorite Python editor? That's one of the questions I always ask at the end of each episode. This week, I want to shine a light on a fantastic answer to that question for Windows developers. Visual Studio. On this episode, you'll meet Steve Dower, a Python core developer from Microsoft's Python Tools for Visual Studio team. He's here to tell us all about it. We also cover Python on Windows, Cpython, the 2016 Build Conference, and more.
This is Talk Python To Me, episode number 53, recorded April 4th, 2016. Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python. This episode is brought to you by SnapCI and OpBeat.
Thank them for supporting the show on Twitter via snap underscore CI and OpBeat. Steve, welcome to the show. Hi, Michael. Thanks for having me. Yeah, we've got some really cool stuff to talk about. I'm super excited to talk about what you guys at Microsoft are up to with bringing Python into all of your major dev products, Visual Studio, Azure, those sorts of things. Yeah, no, it's really exciting.
We've been working on a lot of this stuff for a number of years, and it's really hitting a point where it's starting to come together, and people are making good use of it. So it's very exciting. Yeah, I bet it is. And we're going to totally dig into that. But, like always, let's get started at the beginning. Tell me your story. How do you get into Python, programming, that sort of thing? So my first Python experience was I got a holiday job at a startup company that was doing medical devices.
And they had this ridiculously complicated C++ app for controlling the device that was scriptable with Python. So my job was basically writing the Python scripts to control these medical devices while we were testing them. And then after that, I started grad school, and one of my supervisors said, hey, you should pick up all of this code that I've done previously and use some of that. And I kind of looked at him and said, is this going to help with your work?
And he's like, yeah, yeah, of course it is. But that was all in Python. So at that point, I was neck deep in it and have not yet seen a reason to come out. Yeah, it's a really nice environment, isn't it? It's great. It's just so flexible. And it has so much power that users don't actually have to see in the code that they write. One of my favorite things is writing really complex libraries that look incredibly simple to use.
And Python's magic, metaclasses, decorators, makes that just really nice. You can do a lot of stuff that people never actually see or have to know about. So you'd say that's kind of a different experience than if I was writing C++ with templates and multiple inherences and all that kind of stuff, right? C++. I actually put C++ in the same category. I quite like writing templates in C++, yeah.
But it's definitely a different category from Java or C# where you just don't have the ability to hide so much of the implementation from what users get to see in the code. So the interfaces are a bit more restricted in those languages and you use what you get. Yeah, that's for sure. You work at Microsoft. You said you've been there like four years or so, right?
Yep, coming up on four years, which means following our usual tradition, I need to provide four pounds of candy for everyone, which I'm sure my weight-conscious colleagues are not looking forward to, but I'll make them indulge. There you go. That would probably be easier to do if your job anniversary was around Halloween. The stores are stocked. Yes. With candy. Or just after and then get all the discounted stuff. Exactly. That'd be the best time. So how'd you get there?
I actually got there through contributing to the Python Tools for Visual Studio that I'm working on now. That was one of the earliest open source projects to be done out of Microsoft. It was one of the very first to accept external contributions, and so I was contributing. And that led to an offer of an internship, and so they brought me out from Australia for three months.
And the nicest three months of the year in Seattle are June, July, August, so they brought me for those three months and got to the end and said, what do you think? Do you want to stay? And I'm like, wow, it was beautiful weather. It was sunny. It wasn't too hot. This sounds great. Yeah, I'll come back. And so, yeah, I was contributing to an open source project that turned into a full-time job and a career writing open source projects at Microsoft. Yeah, that's really awesome.
I think those months that I think, you know, I spend a lot of my time in Portland, and we have basically the same weather. Those are like the marketing months, right? People fall in love with the city and the surroundings then, and then the season of rain comes for the next six months. Yeah, it's a complete bait and switch. It is. But you know what's really good is you're not driven to go outside. You're not pulled to go out into the nice weather.
You can just focus, do some programming for six months, and come back out when the sun shines. Yeah, and it's almost like they deliberately put the offices somewhere where people are going to stay in the office for longer. Yes, it is strange that way. Very nice. So that's great. I expect back in that time frame, not so many people were hired at Microsoft to write open source. I don't honestly know how many people were doing it at that time. There were not many.
So my team worked really hard to get the Visual Studio support for Python to be written as an open source project, and many, many meetings with lawyers. I mean, these days, to release something under the MIT license or the Apache license is really, really easy.
But at that point, they spent months dealing with lawyers, explaining what everything meant, letting the lawyers do their research and find their backgrounds and just figure out, is it safe for us to be releasing this stuff under this license? What's our risk? What could go wrong? And eventually, the team just pushed hard enough to make it happen. And without that, there was no open source coming out of Microsoft for the largest part. Yeah, that's really cool.
And back then, that was such a new idea, at least in that space. Obviously, open source had been alive and thriving, but large corporations doing major open source outside of a few places like Red Hat. That was pretty rare. So it's cool that you kind of got to be part of that seed there.
And I think in the early days in Microsoft, a lot of their attempts to do open source came in what I'd consider like source open rather than open source, which means you may see the source, but there's not the pull requests and take backs. And this stuff wasn't really there in the early days for a lot of the projects. Like I'm thinking of ASP.NET, for example. Yeah, absolutely. And some of the licensing that we did, again, it's all about managing risk.
And clearly, at some point, there were a couple of lawyers that, or the entire legal department, decided that the best way to manage that risk would be to create licenses that had exactly the clauses that we were concerned about. And so we had the Microsoft public license, Microsoft reciprocal license, were invented and used for a while.
And fundamentally, I don't think there's anything wrong with those licenses, apart from the fact that they weren't the ones being used by the community at that point. And they never really became common use in the community. So people who are used to saying, oh, this is Apache, this is MIT, this is BSD, I know what these mean, these are familiar, suddenly you see an unfamiliar license.
And without being a lawyer, going through and figuring out that it's the same is, it's not a difficult task, but it's legal work. And so I think people were just seeing those licenses going, I don't really trust this, I don't know this, I don't understand this. Much the same as the people who created those licenses were probably looking at the other ones going, we don't understand these, we don't trust these. What if, what if, what if?
Yeah, this is so different than my corporate software EULA agreement I normally have, this MIT thing, so bizarre. Yeah, and there's basically no language shared between the two. If you go and actually read some of the corporate EULAs, that nobody spends that much time looking over. And I'm sure there's some very disappointed lawyers who put a lot of effort into writing those, that most people don't actually read them. Yeah, that's too bad.
I guess probably in the early days, those types of licenses felt just like, oh, here's a company trying to do open source, but they obviously don't fit in. They just look different. So they must not really be doing it or something. But you guys have adopted the more mainstream stuff these days. You've moved a lot of your source code to GitHub. You've got more standard licenses, things like that, right?
Yeah, and at this point, as I said, for teams that want to do open source work within Microsoft, basically the only choice of license is MIT these days. Apache 2 still gets some use, and I think there's a slight movement away from that, just in terms of what I'm seeing happen at the company. It's all about where are people actually doing this? How are they actually doing it? And we've also had sort of a generation of engineers coming in who are familiar with all this.
So basically everyone working at the company that's under 30 has used GitHub for their own projects. They've been using proper open source. They've been releasing their own code under open source for years already. And so they come in, and suddenly you've got this entire band of junior engineers who know how it should be done, know how everyone else expects it to be done, and is willing to push and make it happen.
So over time, we have definitely moved to a much better place as far as having, as far as, I don't like saying joining the open source community because it sounds like it's really forced, but we've definitely got more products that are considered genuinely open source projects at this point. Yeah, definitely embracing the concept and the community of open source more. So that's cool. So let's talk about Visual Studio and specifically the Python support that you guys built.
Now, I have a pretty wide range of listeners. I suspect most of them know what Visual Studio is and the history there, but could you give us like the 30-second pitch on what is Visual Studio, where did it come from, and why is it special that it has Python support now? I suspect Visual Studio is probably older than me in a lot of ways. It's a very old project that's basically Microsoft's development platform.
So developers who need access to editors, tools, debuggers, and all of the things that come with building and managing and releasing software typically find themselves inside Visual Studio. I first started using it as Visual Basic 4, which was a long, long time ago, and it's grown out of that. I don't have the full history hand here in my mind. I mean, at that point, I was a hobbyist and not an employee. But these days, Visual Studio is very much the development platform.
It's the integrated environment that has all of the editors, all of the tools, all the languages that Microsoft supports development in go through Visual Studio, all of our platforms that you may want to build things for or deploy things to. So everything from Xbox through to phones, which includes all phone OSs at this point. You'll go through Visual Studio for building, debugging, deploying, testing. It really is the home for Microsoft developers.
Yeah, so bringing Python support to that is something that our team has been really keen to do for a long time just because it's already the home for so many developers. And so people who are using C++ or people who are using JavaScript and may want an alternative for another language have historically been switching out to other editors. And there's no need for that.
I mean, Visual Studio has great support for so many languages that having Python in there as well is something that we've always been really keen to have. So we've been working on that for years. And at this point, it's right up there with the other languages, which is great to see. Yeah, that's really great to see. And we don't often just work in one language anymore, right? Like, if you're going to build a web app, you're probably doing some T-SQL. You're doing Python.
Obviously, if you're doing it in Python, you'll be doing some CSS, some HTML, some JavaScript. And the fact that Visual Studio is really good at all of those things and now Python as well, that's really cool because it brings them all together really in one place. You don't have to jump around, like you said. So can you maybe contrast, like, the development experience with, say, like Sublime or Emacs?
Like, why would somebody who's like, I love Sublime, start super fast, it's lightweight, it's free, unless you pay for it. But it'll let you use it for free, basically. I think it's $59 officially. And contrast that with, like, Visual Studio. Like, how much does Visual Studio cost to get going with? Depending on what you're planning on doing with it, Visual Studio is probably free. Visual Studio Community Edition was released, what was that, a year, two years ago?
And that's still part of the current release, is the free version. And that's available if you're basically not a huge company or you're working on open source software. You can freely use Community Edition, which has all of the features of the Professional Edition. It doesn't have the enterprise-level features, but that's mostly, I believe, application lifecycle management stuff that, well, some people absolutely love it, require it, and we use it a lot internally at Microsoft.
It's not critical for small projects. And certainly, if you're using GitHub or some form of public issue tracker, it's not actually that valuable for you, given my understanding. But the free version is widely available, and that includes all functionality. And everything from Python support, Node.js support, and even as we just announced the other week, that's going to include Xamarin for all the cross-platform work that people want to do these days. Yeah, Xamarin's an interesting story.
I don't want to go down that rabbit hole, but just so people maybe don't know, Microsoft purchased Xamarin about a month ago. And Xamarin is basically a development environment for taking code, C-sharp code, and building cross-platform apps that feel native, right? Like, for example, I learned at Build, watching some of the Build videos, doing some research on this stuff, that Slack builds their mobile apps with Xamarin. That's pretty cool.
This episode is brought to you by SnapCI, the only hosted cloud-based continuous integration and delivery solution that offers multi-stage pipelines as a built-in feature. SnapCI is built to follow best practices like automated builds, testing before integration, and provides high visibility into who's doing what. Just connect Snap to your GitHub repo and it automatically builds the first pipeline for you.
It's simple enough for those who are new to continuous integration, yet powerful enough to run dozens of parallel pipelines. More reliable and frequent releases. That's Snap. For a free, no-obligation, 30-day trial, just go to snap.ci slash talkpython.
Yeah, no, it's really nice to have, like, getting back to the right ones run anywhere, but it's a genuine run in the place where you are and not sort of the old completely locked-down virtual machine run anywhere that we had in the early days of Java. Yeah, where you'd open an about box and it looked clearly foreign. Yeah, exactly. You'd open it like a file browser and it was obviously not part of the OS or something like that, right?
Yep. Compared to something like Sublime that's sort of really lightweight, Visual Studio, you're going to find a more featureful experience. So, I know a lot of people love Sublime because it opens quickly. Visual Studio can open quickly, quite often, and they're certainly always working on improving that. But the big difference is once you're in, Visual Studio has much, much better IntelliSense for every language that it supports than you'll find in a lightweight text editor.
And even a lot of the plugins for Emacs and VI don't actually reach the same level of intelligence about your code that we have in Visual Studio. So, things like understanding decorators, recognizing what types have gone into a tuple, and then when you expand that out later, we still know those types. Things like what items have been added to a list.
So, when you iterate over that list later, we can say, yeah, we know it's one of these types because these are all the things that you've put into the list everywhere else in your code for this particular list. Right. So, you get like IntelliSense on the item to the list in your foreign loops, for example, right? Yeah. Which demos really nicely most of the time.
But it is certainly a feature that's very unique to the integrated development environments, the bigger, heavier weight tools that I guess the current generation of advanced text editors we're seeing like Sublime, like Atom, like Notepad++, just don't have that same level of intelligence about the code. I think that sums it up pretty well.
And people who listen to the show a lot know that I kind of come down on preferring the heavyweight IDE stuff that really helps once you get it started with large projects and understanding your code. But I know that not everyone is that way. So, it's interesting to look at the both sides. Yeah. Yeah. And it's definitely interesting to see the difference between different communities of people when it comes to this.
Because I find so, at Build last week, talking to a largely Microsoft audience, everybody knows Visual Studio, everyone loves it, and they don't really know Python that well. But that means that when you get up and show IntelliSense demos, they're just not impressed because they're used to Visual Studio. And they're like, well, you're in Visual Studio. Of course you get IntelliSense. Why are you showing me this?
Whereas when you go to the Python audience, and even people who will flat out say, I don't want to use an integrated environment, it's too heavyweight, it doesn't add any features, and then you show them that you can go to any variable and hit F12 and see everywhere that it's been assigned, or go to the very first place it was defined. You can override and monkey patch functions and see all the places where those were changed and where they all came from.
And suddenly they go, oh, wow, this is amazing. Maybe I do want the heavyweight environment if it has this kind of magic functionality in it. That's right. Maybe it's worth waiting that three seconds for it to start or whatever, because you're going to be in it for the whole day. So let's talk about some of the features.
Before we do, one thing that you mentioned in some of your conversations in Build Conference was sort of about Iron Python and Python 2 and Python 3 support, specifically CPython. Some people listening might be thinking, well, this is Microsoft, it's Windows, it's Iron Python, which is the Python that runs on top of the .NET CLR. Yeah, so Iron Python was a project started at Microsoft. I don't remember exactly when, possibly as long as 10 years ago at this point.
When they were building the common language runtime, there was a small team that decided we should build a dynamic language runtime on top of this as well. So effectively using the .NET platform to do dynamic languages. And as part of that, they built Iron Python and Iron Ruby to use that runtime as, you know, you need to make sure that it's actually valid by doing something useful with it.
And then when that project eventually was not advancing any further in that form and some pieces were taken and used for other things, so people familiar with the dynamic keyword in C# will probably recognize that that came out of that work. But Iron Python and Iron Ruby were effectively pushed out to the community around about 2009, 2010. And since then, Iron Python's been maintained externally. Microsoft has nothing official to do with it anymore, though we do occasionally contribute to it.
But it is, it's Python on top of .NET. And a lot of people still use it. It gets a lot of love, especially from people who have sort of C# or F Sharp assemblies that they want to use from Python or they want to test from Python because it's so natural to just load those up with an import statement and call into it. But there is a big assumption that being Microsoft, that's all we care about. And that's absolutely not the case at this stage and hasn't been for six years.
When that project was released and we started on the Visual Studio support, it was really, really clear that 99 plus percent of Python developers were using CPython and there was just no way that we could cut those people out and say, well, you've all got to switch to .NET to use this. That would have been just ridiculous. So we didn't do it. Yeah, and the guys with things like NumPy, they're like, you know, I kind of like this library.
I'd like to see integration with this package and I don't want to just do some .NET thing. So obviously, right? Yeah, and NumPy is hard enough to build on Windows already that we wouldn't want to be forcing people to have to build it as part of IronPython. Though we did try that for a while. There was a project to get that working that eventually just ran into too many issues. But yeah, CPython is sort of the main star of the show.
for us. So the Visual Studio support extends from CPython 2.5 through to 3.5 with every version in between and 32-bit, 64-bit and everything from debugging, profiling, IntelliSense. We have all the context-sensitive keywords like async and await. We handle all the future imports for CPython properly and all the other interpreters are supported as well. And frankly, they tend to come off a bit like a second thought compared to CPython.
We're very much focused on the same area that the entire Python community is focused on. So PyPy, Jython, IronPython, we test, we use a bit, but CPython gets the bulk of the work. I kind of feel like the entire community is just going to use CPython unless there's some huge pressure from a performance problem or some other type of thing that forces them to go and find some other interpreter or runtime like PyPy, which is really cool, but it's just not the standard.
So you've got to have a really good reason to do that, right? Yeah, and frankly, I'm a little disappointed that Jython didn't get a nice big boost from Minecraft integration. I was really hoping that was going to push it a long way along, but that doesn't seem to have happened. I know a few people have done it, but that could have been a lot of fun. Yeah, yeah, too bad. Let's talk about some of the project types and types of apps that you can build with Visual Studio Python support.
So you guys have web apps, right? Yeah, so a project in Visual Studio, for those who don't use it, is essentially just a collection of files. You can think of it as these are the files that all relate to this one project.
It's roughly equivalent to these are the ones that I check into source control or the things that I may want to edit within Visual Studio, but a project also includes things like launch options, debugging options, and so there's a few sort of categories of those that we like to start with. So web projects quite often have different launch options. So rather than just typing Python name of the script, you'll do python-m bottle name of the script, or python manage.py run server to get it going.
So they have different launch options. So we provide some projects that pre-configure those effectively so that when you go and hit F5 to start running, it's already set up for running that web project. but the project itself is not actually that constraining and it's quite easy to configure a regular project to be a Python project and we've actually got some future work coming, which I think we'll talk about future work in a bit, that we'll just get rid of projects completely.
Oh, how interesting. Okay. Well, that sounds really cool. So if I have like a Flask app and it's got all of its templates, does it understand, does Visual Studio understand like the Jinja 2 or Chameleon templates? So we don't have Jinja 2 yet. A while back, we invested in Django templates and have that there.
So if you're using Django and using the Django template syntax, now this is before they offered Jinja 2 as an option, then you'll get IntelliSense within the template file, you'll be able to debug, you can set a breakpoint in the template and it'll stop and you can step through your template as it's being generated on your local machine. Yeah, the debugging of the templates, that's pretty awesome because sometimes when template binding goes wrong, you're just like, why is this not working?
It's really hard to understand like when it's handed off to the template engine, like what's going on anymore? So that's pretty cool. Yeah, and definitely when things go wrong, you don't always get the nicest stack trace out of it. So being able to stop execution just before something gets rendered incorrectly and inspect and see what's going on is really helpful. Yeah, a lot of times it's kind of like there was something wrong with your template. Yeah. Or your data going to the template.
Sorry, because it's just the call stack of like the template parsing. So that doesn't help. Yeah. Sort of generic Jinja 2 support is on our wish list of things we'd love to do. We briefly investigated updating the stuff we have for Django to support Jinja and it's not quite feasible yet. Django, original style Django templates were mostly handling with regexes because they have a more restricted format. Jinja 2, you can't do that.
Jinja, we need like a full HTML slash Jinja parser to be able to figure out how it all works. So that's on our wish list. We'd love to have it and we just haven't had a chance to get to it yet because turns out writing a parser is a big task. Yeah, I'm sure that it is. So if somebody's out there listening, they're like, I could totally write that parser. Do you guys take contributions and stuff? Absolutely. GitHub.com slash Microsoft slash P-T-V-S.
That's Python tools for Visual Studio and yeah, come let us know that you're interested. We're happy to help you out and we'll accept pull requests. We've already accepted one for our next big release. So people who are looking for brace completion, that was contributed by an external person who basically just came along and said, I really want this. I'm willing to do it. Here's the code. What do you think? Oh, lovely. This episode is brought to you by OpBeat.
OpBeat is application monitoring for developers. It's performance monitoring, error logging, release tracking, and workflow in one simple product. OpBeat is integrated with your code base and makes monitoring and debugging of your production apps much faster and your code better. OpBeat is free for an unlimited number of users and starting today, December 1st, OpBeat is announcing that their Flask support is graduating from beta to a full commercial product.
Visit opbeat.com slash Flask to get started today. So one thing that I saw that you guys can do, I think it's sort of special because the deep relationship with C++ and C and Visual Studio. Like, my first experience with Visual Studio was with Visual C++ 1.52 back in like 1994 or something. So it's been C++ capable for quite a while. And one of the things you can do is you can like mix mode, you called it mix mode debugging, right? That sounded pretty cool. Can you talk about that?
Yeah, so it's actually one of our most popular features. It's unique to Visual Studio. We're not aware of any other development environment out there that can do this. Though GDB has some extensions that get kind of close. What it essentially is is when you have Python code calling into a C module, so one that you've written and built yourself, when we have the debugging information, we can give you a debugging view of both the Python and the C code simultaneously.
So you can set a breakpoint in the C code. You can set breakpoints in the Python code. You can inspect variables in each one and see, so from the C code, oh, I've got a PyObject star. If I hover over it and have a look, it'll show me what it would look like as a Python object, whether, you know, a list of items or a tuple or a dictionary and step between the two different worlds.
And so you end up with this call stack that goes Python, Python, Python, Python, C, C, C, C, Python, Python, Python, which is amazingly helpful when you're trying to debug native modules. It's actually something that I had to do a lot when I first started and we didn't have this feature. So I know how incredibly painful it is to do without having this sort of layer on top that shows you all the actual Python values that you'd be missing otherwise. That is super helpful.
So I guess anyone out there is listening who's writing some sort of C extension and wants to help debugging it, you know, try the free Visual Studio version with Python tools included. That'd be awesome. So you want to talk about some of the other project types? one of the things that seems like Microsoft is up to these days, last four, three or four years, ever since such a Nadella's taken over, I guess, is you guys seem to be all in on Azure.
And so you could actually have support for Python and sort of deploying straight out of Visual Studio into like a web app running on Azure, right? Yeah, so Azure web apps, kind of the highest level, most managed platform, I guess, for deploying websites. It's really, really quick to just push up the code for a site to, and now you have an active website. So there's no setting up machines, there's no installing web servers or doing some machine level configuration.
It is within a minute of saying, I would like a website. You've got a website, which is really, really cool. And so the support that we have inside Visual Studio for that just brings that down. It's just bringing the click count down because you can do all of this through FTP or you can do it through via a Git repository. And then there's sort of the one click, I have my files here on my machine, I want them on that machine, just go and do it and we'll go off and do it.
I really like the websites that you guys have in Azure. Like if I need a little small website that I can just spin up really quick, my first thought often is just go to Azure because there's nothing to set up. And you can have up to 10 sites, I think, for free, like 100% free forever. That's pretty awesome. Yeah, I think 10's the limit there.
And I mean, if you want to try it without even signing up, then you can go to, I think it's try.azurewebsites.net and we'll give you a free site for an hour without any sign up, no credit cards or anything at all. We'll just give you a site, we'll give you a Git repository and so you can push directly to the site and have a website running.
And there's a whole lot of templates in there if you want to start from a Django or a Bottle or a Flask site or if you're interested in doing it in PHP or Node.js, we have like, all of the languages are supported for websites and so that try.azurewebsites.net is just a really quick way to get a website going and see whether it does what you want it to.
another one that I saw that I have no experience with so you'll have to tell me a little bit about it is when I was playing with the Python projects, I saw that you have a Windows Internet of Things core, maybe Windows core for Internet of Things, as a Python project type. What's that? There's a team at Microsoft at the moment that's been working on what's known as Windows IoT core. It's basically a version of Windows that is really, really stripped down.
It's still sort of the latest builds of Windows but there's a lot of unnecessary things removed and it's really designed to be run on like Raspberry Pi 2 or sort of about that scale devices for sort of high level Internet of Things type tasks.
So it's not the little tiny microcontroller device that's just got a sensor attached to it but something bigger where maybe you've got a running process that's going to pull down a whole lot of data off the Internet, do some processing, display it on an attached screen or device of some sort and that platform has a slightly different app deployment model than on like the Raspberry Pi OS or some of the other IoT things. So it is running Windows.
One of the big benefits of that is the security you get out of it in terms of you can't just run unsigned code on it, you can't jump outside of the sandbox that the code is running within and it has a lot of those benefits and what that means is that you need to go through a couple of extra steps to deploy code to it in the first place. So that template is actually very different from all the other templates we have. but it is a good starting point for IoT.
You jump into that, you get a special version of Python that we had to rebuild so it's Python 3.5 rebuilt to run on IoT Core. I believe something like 95% of the functionality is there.
There's a few features that had to be removed because they would not work within the sandbox that's provided but within that you can set up a background service, it can do network access, it can do processing and all of that will then be easily deployed to Raspberry Pi 2 or any device, I forget the other ones that it will run on but anything that Windows IoT Core will run on can run those Python applications and from within Visual Studio you have sort of that one click deploy and run, you can F5
to deploy and debug and we'll use our remote debugger to attach to it and you'll get the full Visual Studio experience of stepping through, inspecting variables while running on a little tiny device. That sounds awesome. I should check that out.
Yeah, and not to exclude the other ones, if you are working on an original Raspberry Pi or a different OS then Visual Studio has remote debugging for Python so it's a little module that you can put with your code on any platform on clusters of Raspberry Pis and use Visual Studio to do their debugging by connecting to it from their Windows machine. That I haven't got to play with but it sounds really handy. Awesome.
Can you give us a glimpse of maybe something that's coming that people don't know about like a feature that's under development that's pretty cool? Basically everything that we do that we're actually doing is going to show up on our GitHub site so if people go and look at the commits there you can see what's definitely coming sometime soon.
There's a lot of things that we talk about that don't always make it past the talking stage so it's kind of hard to say from this huge list of stuff we say yeah we'd love to do this we'd love to do this which ones will make it to the stage of we're actually doing it.
One thing that is getting very close to that second step and is support for Visual Studio Code so people who may not be familiar with that recently in fact about a year ago Microsoft made the first release of Visual Studio Code which is a cross-platform version of Visual Studio it's lighter weight it doesn't have a lot of the advanced functionality yet but it's much more comparable to something like Sublime Text in terms of I have a directory of code here I just need to jump around in it a bit
I still want good IntelliSense I still want the ability to navigate based off code semantics rather than simple searching I need git integration I want F5 to debug and we're at the point where 99% certain that we'll be committing to like really beefing up the Python support there it has basic support for a lot of languages including Python but there's not yet any debugging there's very limited or no IntelliSense and launching is not quite there yet so there's a range of things to work on
there's currently a community extension that's doing it and we're thrilled to see that the community has said hey we care enough about Python to make this happen regardless yeah that's great do you know the name of the extension so people can search for it or I can link to it the extension's Python so if you just X install Python from within Visual Studio Code you'll get it it will make it difficult for us if we put out another Python extension because we'll have to pick a different name
oh yeah they really grabbed the main name didn't they yeah they went and took it so there's always a possibility that we'll get in touch with the guy who's created and say hey you've already got users you know everyone already loves this one can we contribute to it and then you know maybe we don't end up with a an official Microsoft one but we really beef up the community owned and driven one already with with all of the stuff that we've got from Visual Studio proper we'll try and bring that
over to Visual Studio Code and get that out there so not quite sure how that looks right now not quite sure when it's going to be available but it's definitely something that is coming and so there will be cross-platform Visual Studio Code Python support coming soon yeah that's awesome it's nice to see Visual Studio Code coming along and with the whole .NET Core stuff and I talked to Brett Cannon he was on show 49 about some of the the pigeon work that you guys are doing
involving .NET Core and cross-platform so all those things are coming together really nicely but let's take it back to Windows for just a second so as somebody who teaches Python I want to say thank you for building the new Windows installer for CPython oh my god that has been such a nightmare that to try to you know people come to class they've got some crappy old laptop they got from their company you know it doesn't have Python on it and they want to get started and they forgot to check
the little box put this in my path and it's just oh you know there were so many little gotchas and you recently updated that in a pretty major way right?
yeah so what was it PyCon last year I think or might have been the year before 2014 I think the the person who was responsible for producing the builds of CPython for Windows effectively resigned and said I've you know I've got other things I need to step away for a bit so if someone else wants to take over then they're more than welcome to and thinking it wouldn't be that much work I put my hand up which turned out to be a silly thing to do but that's what I did and so since then I've been
largely responsible for excuse me for a lot of Python on Windows one of the things that I've been really keen to do for a long time and was kind of going to contribute it anyway was to rewrite the installer and I mean frankly I'm still not entirely happy with where it's at but it's not something that you can change dramatically too often but one of the big well I can tell you it is a much nicer experience than it has been so I'm I can definitely say that so people who have tried to like set up
Python on Windows before and be like oh here goes this thing it almost works it's a lot nicer so it may have ways to go but it's great yeah and I did achieve two of the big things that I wanted to do which was moving the default installation directory into somewhere more secure because historically if you put Python in the root directory of your system drive anyone on that machine can write to it and that then means that someone who's not an administrative user can install whatever package
they want and then if someone who is an admin runs that Python at all they're going to run that code that's been installed by someone who shouldn't have privileges to install it for them so that was always a security concern for a lot of Windows users a lot of corporations and so by moving it either into program files or into the user's install directory that mitigates that attack vector which is a real big improvement for a lot of people the other thing is a proper per user install
so previously if you installed Python you could say install it just for me but you still had to be an administrator to actually install it so one of the big big changes that I made in that installer was so if you choose that and then you choose not to install the launcher for all users then you don't need to be an admin at all and we'll just go ahead and install Python without ever asking you to elevate so it's great for students who may not have full control of their machine people working at
companies where the machines are locked down and they're not allowed to make changes to it you can still install Python 3.5 on those machines because we don't require to actually make changes to the machine we just put all of Python into a directory that you have full access to already yeah I've run into that problem more than once that people even though they're professional developers at a company they're still not given enough control of their machines to make system level changes which is
kind of ridiculous but it's great that that's all there so very cool let's talk about build for a little bit so this is kind of like Microsoft's major developer conference and you were there I saw you were giving some talks on Python you were kind of spreading the good word of Python saying look I know a lot of you guys here that guy is doing C++ you guys are all doing
.NET but maybe you should consider Python can you maybe give us your impressions of what you guys announce this year and how did your session go build always has a lot of exciting announcements and even for employees we don't know a lot of the stuff that's going to be announced there so we're all watching the keynotes the same as everyone else and seeing all the exciting stuff coming out I'm still waiting for the day when we get to make some big Python announcements from the keynote stage but
that's probably a couple of years away still at this point but I'm hoping for that but yeah there's definitely so much coming out I love the idea of conversation bots I really like that idea of making so many of these interactions more natural I definitely feel like we've gone from where 10 years ago you'd call up a hotel to book no one does that anymore you go to a third party website that will do the booking for you and it's gotten very impersonal and I don't actually see that undoing
completely but having the sort of conversational option to do something like that where it can use context because it knows about you having I guess an interactive dialogue to achieve a task as opposed to where in step one step two step three wizard kind of format feels like a great step into a really exciting future yeah it is pretty cool and just to kind of take a step back for listeners who maybe didn't see the you guys announced this thing called a bot framework which I then announced it and
said this is for C sharp and no JS bots and so of course the first thing I did is went off to write a button Python did it work it did it worked great the documentation is not quite thorough enough to make that easy for people to do because the first step is install this library or install this library and until we have a Python version of that library which is something that I'm really keen to do now it's not quite trivial to get it up and going but even without that I managed to get a bot
going that you can chat with through the framework and so then the nice thing about fitting into the framework is you get all the connectors so it's instructions are provided for connecting that bot up through telegram through twitter through twilio through so many of these services that if you want to interact with it by email or by phone call or sms you can just do that and so that's a really cool thing about that framework is you write a bot once and then you can reference it from all of
these services that support bots in some form yeah it looks really cool and for the data scientists out there listening the back end stuff you guys are doing with machine learning and natural language processing there's a lot of really cool semantic understanding of written text and stuff so I think that was one of the really interesting ones you guys did a bunch of open source announcements so we talked about Microsoft becoming more open source this was absolutely evident there that was super
cool to see but one that surprised me I did not see coming at all was Ubuntu on Windows tell me what that is I don't think anyone saw that one coming I wouldn't have been surprised if the CEO whenever they went and told Satya hey we're going to announce this at build if he wasn't completely shocked out of his seat no it it really cool it is like so I've had a chat with those guys and it really is such a nice thin layer on top of the Windows APIs that you'd never see so it's not like Sigwin where
you have a different set of libraries to build against it's a kernel shim so everything is already built for Ubuntu and it is literally we just copy the binaries over and every time they go to call into the kernel that gets intercepted and rewritten into the Windows kernel calls but it's completely transparent you don't have to rebuild anything you don't have to change references and so when you get bash and you just get into and start calling stuff it's all the exact same elf binaries as you'd
have on a machine that has Linux all the way through instead of being this layer on top of Windows and the thing that really blew me away is I didn't test this but I saw the blog post the performance is apparently right up there with a native Linux machine which is incredible that's really awesome so people who love their Linux tools which a lot of Python developers do this is coming to Windows basically in a native sense right what's the timeline did you catch that no I didn't catch the
timeline but I understand it's in the current preview releases so if you're part of the Windows Insider program then you should either have a build with it or you'll soon be getting a build that will let you try it out I got I the since it was coming with the anniversary update of Windows 10 I expect that's when it'll come out but certainly there are early builds available I've used one but I get access to the daily builds but the insider builds are not that far behind they're typically only
three to four days behind what we have access to as employees so there should be one out there at this point already though I haven't checked so I could be wrong but it's very cool yeah I'll be sure to link to that in the show notes as well all right Steve we just have a few more minutes so time for a couple of closing questions this one is going to be a softball for you what's your favorite Python editor Visual Studio that's awesome isn't that the answer everyone gives yeah that's well I am
trying to spread the word I think it's great what you guys are doing there so congratulations on that and I always ask you know there's so many packages on the Python package index on PyPI at least 75,000 last time I checked the number there's got to be a bunch that you use that maybe people don't know about you like you should check this out it's awesome what one's yours that comes to mind well okay so leaving out the ones that I've written myself because that seems a little unfair though I do
like the project Oxford library which does text-to-speech and speech recognition and natural language understanding using what's now called the Cortana intelligence suite that's a fun little demo one that I wrote probably and certainly if you asked all my colleagues I talk about requests all the time and and that's largely because I keep seeing code that's using htplib and my answer is always just use requests please just use requests stop using anything that isn't requests so that's almost
certainly my favorite library and if you have used htplib stop using it and use requests and you'll see why okay final call to action how do people get started with this this whole thing that you guys built so aka.ms slash python is our sort of short link and that will get you to right now it gets you to the visual studio page about Python support depending on when you come back and listen to this podcast it may be pointing somewhere else but that's always going to point to the best landing page
for whatever Python stuff is going on at Microsoft probably the second one is aka.ms slash python blog which is our team's blog so we're posting about once a week on everything from what are we doing at Microsoft with Python what is going on in the community what some ways of improving your coding style and that's where you'll get the latest news about whatever Python stuff is going on at Microsoft I set it up the other day on my fresh new version of Windows 10 and it was no problem nice
and easy just install Visual Studio install Python tools and file new project pick your Python flavor and go right it's very nice I'd also like to add one more thing people out there listening who haven't checked out what Microsoft is doing for a while you should check out the build keynotes I'll link to them in the show notes there's some really different stuff happening at Microsoft than 5-10 years ago yeah it's very exciting I love that we're really getting innovating again definitely
congrats on all the stuff you guys are doing Steve it was great to have you on the show thanks for giving us an this has been another episode of talk python to me today's guest was Steve Dower and this episode has been sponsored by snapcii and opbeat thank you guys for supporting the show snapcii is modern continuous integration and delivery build test and deploy your code directly from github all in your browser with debugging docker and parallelism included try them for free at snap.cii slash
talk python opbeat is mission control for your python web applications keep an eye on errors, performance, profiling, and more in your Django, Flask, and even pyramid web apps. Tell them thanks for supporting the show on Twitter where they're at opbeat. I use both of these products on all the talk python web properties and you should check them out too. They're really excellent. Seriously. Are you or a colleague trying to learn python?
Have you tried boring books and videos that just cover the topic point by point? Check out my online course python jumpstart by building 10 apps at training.talkpython.fm. The reviews so far have been fantastic. You can find the links from the show at talkpython.fm/episodes slash show slash 53. And be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find the iTunes and direct RSS feeds in the footer of the website.
Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix. You can hear the entire song on talkpython.fm. This is your host, Michael Kennedy. As always, thank you so much for listening. I really appreciate it. Smix, it's time to take us out of here. It's dating with my voice. There's no norm that I can feel within. Haven't been sleeping. I've been using lots of rest. I'll pass the mic back to who rocked it best. I'll pass the mic back to who rocked it best.
Thank you.
