Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Lap Around Python in Visual Studio 2017 (msdn.microsoft.com)
109 points by LyalinDotCom on May 12, 2017 | hide | past | favorite | 41 comments


Who would have thought 5 years ago that today some of the best tools for Python development would be developed by Microsoft as part of Visual Studio?


This is great, this will help getting support of a Python "stack" for enterprise projects. At the moment I am mostly doing them in C#/VB.net and always need to discuss a lot to get Python acceptance when scientific workload is required (it is easier to say Fortran + C#/VB.net than Python!).

Now, I will be able to add: "Microsoft is fully supporting Python" and this will basically close the deal. I am happy.


/team lead here/

Thanks!

Regarding "Scientific" - we just added the Data Science Workload to Visual Studio 2017. Check it out here:

https://blogs.msdn.microsoft.com/visualstudio/2017/05/10/bui...

Basically Python + Anaconda, R + Microsoft enhanced R, F# with .Net as a single install. Python & R work with any interpreter, including IronPython & Pypy.


Thanks a lot! This is exactly what I need, this will ease my arguments when I need to port/bring some "Matlab" code/models into a GUI tremendously.

Now, /me is dreaming of a cross-platform WPF with Python as language and integrated in the IDE like C#/VB.net. I am using PyQT but this is not the best on Windows.

On a side note, just comparing Visual Studio today and Visual Studio of my first real work days in VC++/MFC (something like 20 years ago), I must say that it really makes me ship good software faster and better. Thank you!


Using Visual Studio with Conda would be a really good compelling way to get it into Enterprise projects. Conda's packaging requires much less effort.


/Dev on Python Team chiming in/ You can use conda + PTVS. About half of my python installs are Anaconda and it works well for me. When you right click on your environment in solution explorer, you can select to install packages and change between pip, conda, and easy_install.


Windows has had Python support from the official version of Python since 2000. Microsoft supported and helped create IronPython from 2008.


/team lead/

This is true, although IronPython is managed by the community and is doing well. Visual Studio supports IronPython, CPython, Pypy, ...


And on the other side of the fence there's XCode, unable to refactor Swift …


Just talking to some swift/iOS devs that I've done some projects with the other day, and their workflow basically uses the JetBrains IDE and Xcode simultaneously - one for code and the other because the JetBrains offering apparently doesn't support storyboards (yet?). Coming from a backend perspective, it sounds pretty atrocious.


Wow, that looks like a lot of really cool stuff. Might have to get back in a python kind of mood, this really looks impressive, especially the c++ extensions.


I do a lot of Python work and like most of the other "heavy" IDEs, this doesn't appeal to me at all. The more layers of stuff you wrap around what you're trying to do, the harder it is, in my experience, to make it easy to deploy and maintain. I guess I'm turning into a graybeard.


> The more layers of stuff you wrap around what you're trying to do, the harder it is, in my experience, to make it easy to deploy and maintain.

I'm not sure how your choice of editor has any impact on your ability to deploy and maintain your code.


/team lead/

Totally understand - Visual Studio can be somewhat heavy weight especially for basic editing. In that case, check VS Code's Python support. It's very lightweight and cross-platform:

https://code.visualstudio.com/docs/languages/python


I can see how the value of an IDE is much smaller in a dynamic language than a statically typed one. In the statically typed language compiler output, test output source symbols etc are links to other things in the project. That's hard to accomplish in an editor + shell setup (or requires a huge config effort that effectively makes the editor an IDE). I would use vscode or similar if I did JS or Python, but for C# or Java you'd have to pry the IDE from my cold dead hands :)


Even with a dynamically typed language, the IDE can do type inference to provide a lot of useful stuff, like go to definition of a symbol, or refactoring.


And when the IDE exploits Python 3 type annotation, the "static vs. dynamic" gap is much less painful.


The reasons to stick with macs are getting fewer and fewer by the day...


Why did you ever need a Mac for Python and what's so different now? macOS comes with Python built-in but in terms of IDE's there's PyCharm for macOS and PyCharm for Windows and they're both just as effective. You just install them. Code.


Python specifically, no particular reason. As a cohesive environment, Microsoft is chipping away at every reason I've had to stick with Macs and their limited selection of hardware. Learning that a new Mac Pro is at least a year away has me looking MUCH closer at Windows. And bit by bit, Microsoft is crossing out all the reasons I had in my mental "No Microsoft" column.


Since I'm a Cocoa developer and I don't like change for the sake of change I'm just using Parallels for Visual Studio and Windows software development and macOS for my main OS. I don't particularly dislike Windows but it's still a bit messy.

However under the hood Windows is catching up if not overtaking macOS since Windows Vista. I'm probably one of the few people that thought it was an amazing improvement over Windows XP at the time (using it on a machine with rock solid driver support perhaps helped). The graphics subsystem, security, driver model: everything was better.

I just want Windows to be incrementally improved and homogenized for a long while instead of half assed system wide changes every other release. The real beauty of macOS in my opinion is that somebody coming from the betas on a BW G3 in 1999 would still find his or her way easily on a 2017 Mac. But when they changed it from OS 9 to OS X they did it drastically and with a pretty clean cut from the past.


Yep. Especially after they added WSL to win 10. I've primarily used a 3 year old macbook for development at home. But my employer hands out win10 laptops for day to day work. Now with WSL, I don't really miss the mac much. Most likely will hold off on buying a new macbook and just go with something like XPS 13 with win10 in the next year or two.


I love finally having tmux support on my Windows machines - just wish that we could have that in the PowerShell terminal as well.


Development on OSX has never been that great. It's tolerable for iOS and OSX apps because it's the only option, but for any other target Linux and Windows are better. That's become even more true as Apple's focused their devices more on content consumption.


(Entirely unrelated to the actual contents)

I find it remarkable how visually inconsistent all of the shown screenshots are. (Look at all the small details that differ between each screenshot, like margins around buttons, button sizing, size of text entry fields, chevron styles and so on and so forth)

Windows (in this millennium, anyway) was never a really visually consistent OS, because it pretty much always had some leftover crud GUIs, and even today some dialogues from the early 90s exist nearly unchanged, though.


I use Visual Studio for work. I'm not seeing all the inconsistencies. The only component I loathe is the git integration.


What ever happened to IronPython running on the CLR?


It was divested for a number of reasons. First, there was (and still is) the Python 2 to 3 transition. Supporting Python 3 added a lot of overhead while full Python 2 support was not available yet.

It also turns out that a lot of popular Python libraries have dependencies on C/C++ code, so there were attempts like IronClad to provide support for these, but it wasn't as easy as CPython. There were benefits like the CLR being able to handle some workloads better than CPython with its GIL, but there are expectations in some libraries that it's CPython running the code.

Startup performance also takes a hit due to jitting, so IronPython had to implement some tricks to make it run scripts fast on the first run. This is a pretty common case.

Then you add in compatibility and testing with frameworks like Django, and balancing that against further development of the core. Even if you support these frameworks, you may not be able to support some of the libraries and tools that these developers coming from the open source world use, so their experience can be soured and the project appears to be more of a science project. That said, IronPython can excel in niches, such as adding scriptability to your .NET app. But that's not going to take over the world.

These problems also applied to IronRuby. Both of them seemed to be joined at the hip in terms of management, so I think that internal dealings at Microsoft were part of the downfall. I have no idea what happened, but in the bigger picture at that time, Microsoft was finally learning to do things a better way with ASP.NET MVC. For their constituents that may have been a better investment.


Plus, now you have Python for .NET[0] and similar projects that allow you to seamlessly integrate CPython into your .NET program. This gives you the best of both worlds and negates a lot of the value of a dedicated .NET Python implementation.

[0]: https://github.com/pythonnet/pythonnet


You can also use .NET assemblies from CPython using pythonnet, so it is bidirectional interop bridge!


Damn, they are killing it.


I was really hoping Visual Studio 2017 for Mac would support this, but it looks like it doesnt have full extension support yet.


/team lead/

Unfortunately VS for Mac currently doesn't support Python or R (the two languages our team supports). However, if you are interested, please file the request on uservocie - that really helps us convince mgmt.

Meanwhile, VS Code has pretty decent Python support which can be used on Windows, MacOS and Linux:

VS Code: https://code.visualstudio.com/docs/languages/python

uservoice: https://visualstudio.uservoice.com/forums/121579-visual-stud...


Visual Studio for the Mac is a re-branding of Xamarin Studio, so it doesn't actually share any code with Visual Studio for Windows. I doubt that VS Windows plugins will ever work with it.


I really liked the VS IDE when I was a windows programmer, I'm still struggling to find something comparable.

My fears are still that python code on windows is still a nightmare, especially when you throw something like OpenCV into the mix.


/team lead/

Your fears regarding Python on Windows were quite justified. However, the world has dramatically changed, thanks in large part to folks like Continuum.io and their Anaconda distribution, Christoph Golke, and many other wheel providers.

Visual Studio actually provides an option to download Anaconda for you. It has a few hundred pre-built Windows pkgs ready to go. We also use it on our free jupyter notebook service and have been very happy with it.

UCI repo: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Anaconda: https://www.continuum.io/downloads

Azure Notebooks: https://notebooks.azure.com


/Dev on Team/ Also many packages, NumPy for instance, have improved their builds for Windows. This is a combination effort of better support on the platform side to make things better but also from package maintainers to support Windows users better.

If you have been away from Windows for a bit, I think now is a good time to at least take a cursory look around again ;)


Has anyone used this for Django development? I currently use SublimeText 3 for just about everything but I'm always open to new ideas.


/Dev on Team/ I have used it with Django, but most of my Django apps are mere toys compared to things that other people are working on. This probably isn't that useful of a video, but this was a talk at PyData using PTVS + Django to demo some Azure Services https://www.youtube.com/watch?v=PElcaj1iylA


This looks awesome.

Does anyone have any opinions on how this compares to pycharm for similar IDE functionality and jupyter support?


my first experience was with python tools for visual studio 2012. i still use vs2012. its a charm.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: