top | item 5977695

Python Tools for Visual Studio

412 points| numo16 | 12 years ago |hanselman.com | reply

130 comments

order
[+] CurtHagenlocher|12 years ago|reply
This doesn't even mention the most awesome feature of PTVS 2.0: mixed-mode debugging, which provides an integrated experience for debugging mixed Python/C processes. See https://pytools.codeplex.com/wikipage?title=Mixed-mode%20deb... for details.

Disclaimer: I used to work on IronPython.

[+] ibejoeb|12 years ago|reply
Microsoft really does make the most outstanding developer tools. I admit that I occasionally miss that deeply integrated, seamless feeling.

You guys deserve some recognition. I'm not too frequent a user lately, but I'm continually impressed.

[+] _pmf_|12 years ago|reply
> This doesn't even mention the most awesome feature of PTVS 2.0: mixed-mode debugging, which provides an integrated experience for debugging mixed Python/C processes.

That's really nice. I wish there would be something comparable for debugging JNI/Java code.

[+] ryanmolden|12 years ago|reply
The guy that wrote this used to work on my team and is a great dev. If you run into any issues I could certainly point him your way.
[+] stinos|12 years ago|reply
Afaik that's exactly what the first all-in-your-face picture is showing? And man that is seriously awesome indeed.
[+] cdavid|12 years ago|reply
Can you expand a bit on how that works in principle ? Can you make it work with a standard python or did you need to insert probes' into the python interpreter to catch when it goes form C to Python and vice et versa
[+] ww520|12 years ago|reply
Another Microsoft's best kept secrets is using Javascript for shell script. It has been there forever since Javascript first came out. It's called JScript but it's just Javascript with Windows support like running ActiveX Objects, which let you access the file system, OS, network, etc. You can pretty much drive the Windows system with it through ActiveX Automation. Also you can do Office application integration like Excel Automation with it.
[+] drmohundro|12 years ago|reply
Related, but for the same reasons, you could also write classic ASP using JavaScript (as opposed to VBScript). Years ago, I spent months trying to convince my team to let me use JavaScript instead of VBScript in our ASP files.
[+] cfn|12 years ago|reply
And more: you can create new ActiveX Objects from within that JScript script giving you access to just about anything. This has been there forever (I started using this in 2006) and I use it to let my users insert their code into the process of my desktop application.
[+] jroseattle|12 years ago|reply
For me, Msft and JetBrains provide the best IDEs for getting work done. The majority of my work is in Java, C#, and Python.

At the moment, I use PyCharm for python projects because I'm usually working on OSX (and prefer the local unix-y environment instead of the Windows-virtual-machine thing.) However, I started with PTVS years ago and really like it.

MSFT adding IDE support for Python is a good thing -- as developers, we need more options, not less.

[+] loudmax|12 years ago|reply
MSFT porting VS to Mac and Linux would give developers even more options.
[+] jessaustin|12 years ago|reply
I chuckled at: "Django (Python's Web Framework)". Someone has missed out on years of hand-wringing about our menagerie of frameworks.
[+] shanselman|12 years ago|reply
;) The PTVS guys said they are going to add support for Flask and Bottle soon.
[+] drawkbox|12 years ago|reply
I primarily use Sublime, TextMate or Komodo on Mac for python dev but would love to also use VS. I do run windows and do most dev on that under VS. Maybe one day VS will come to Mac, I know that doesn't follow the platform mission but would get some good traction for Visual Studio going forward and a little fire under Xcode for C/C++ dev on Mac.

At this point both XCode and VS are pretty equal but XCode I also like and have no problem with. Both are unique to the OS though. Both are also extremely bloated but needed for C/C++ dev. Eclipse is also a bit cludgy. That python to native screenshot on the site looks intruiging.

I do use MonoDevelop on Mac for Unity dev and it does support debugging but would love to use VS on Mac one day.

All in all when I do python dev I like less in my IDE at times, just a good autocomplete/intellisense and I usually despise integrated source control into IDEs preferring to do it with outside tools such as terminal/cmd, sourcetree or tortoises. SCM integration in IDEs always seems to kill performance and gets out of sync, especially in the latest MonoDevelop (startup indexing kills the usefulness - http://answers.unity3d.com/questions/356129/monodevelop-perf...).

[+] stevoski|12 years ago|reply
Try PyCharm. It works on Mac and Windows and is miles ahead of XCode for Python.
[+] schrodinger|12 years ago|reply
One thing that drives me nuts in Xcode as opposed to VS is that the autocomplete only completes when you hit tab. I want it to compete when I hit a period or a space too like it does in VS! Considering you find them both basically equal, have you found a workaround for this or is it just not frustrating to you?
[+] yngccc|12 years ago|reply
VS 2013 now comes with way more editing options than Xcode. It always drive me nut that I couldn't make IDE automatically insert space around function parameters, because it is not a popular style.
[+] jaegerpicker|12 years ago|reply
I love Visual Studio but after having worked with python quite a lot and being involved in the local developer community (IN NEOhio, NYC, and starting into Southern Maine) I think I've only ever meet two python developers who used windows as there development Os. I'm not holding my breath but if MS would port VS to OS X/Linux it would be really cool. I don't know that a good business case could be made for it though.
[+] amjith|12 years ago|reply
Do people run django production sites on Windows? Not trolling, genuinely interested.
[+] randlet|12 years ago|reply
I run a couple of medium sized intranet projects with Django on Windows Server 2008/SQL Server 2008. Not ideal but if you want to use Django, it's sometimes a necessity in corporate MS only environments.
[+] mumphster|12 years ago|reply
I currently maintain and run a big ol' Django project running on Apache/Windows/MSSQL (and some Oracle) here (university of Arizona). It's not that bad although myself and the other developer both use mac's so its annoying having to RDP in to do anything in a python shell.
[+] skrebbel|12 years ago|reply
How is that relevant? One of the nice features of a language like Python is that it's very easy to write cross-platform code with it. You really have to do effort to code a python web app on Windows that breaks on Linux. The same holds for e.g. Ruby, Node.js and Java.

I prefer Windows for a dev platform (really, I do), but I've only once written a webapp that was hosted on Windows. I'd much rather prefer unixy servers.

[+] patja|12 years ago|reply
Does anyone have experience with the free VS Shell mentioned in the article as the foundation for putting together a free of cost installation?

How does it compare to VS Express? Why would there be two different free Visual Studio offerings...just to keep things locked down and rule out support for add-ins?

[+] overgard|12 years ago|reply
I think the idea of the visual studio shell is to have sort of a blank slate of an IDE for people to write their own plugins for. There's no language support, just the blank canvas.

Anyway microsoft doesn't provide support for their core languages (C#/C++/VB) for the shell, so the main consequence is that, in the shell you basically get all the languages microsoft /doesn't/ directly support in visual studio, but nothing else. Whereas in the express editions you have an IDE you can't extend, but each edition supports one of microsoft's core languages.

[+] smortaz|12 years ago|reply
overgard is correct.

Our PTVS + integrated/isolated shell basically gives you a virtual "Python Express". However recently msft has moved away from the "Express" model to "Scenario" models. ie, VS for Phone, VS for Desktop, VS for Web, etc. and each includes all the tools and multiple languages you might need for that workload. We're hoping to include PTVS into the desktop & Web scenarios in the future.

[disclaimer: project lead]

[+] jahewson|12 years ago|reply
There are a lot of Python IDEs out there, some very good, such as IntelliJ IDEA. I'd prefer to see an objective comparison.
[+] smortaz|12 years ago|reply
[PTVS project lead]

Yup, try PyCharm, PyDev, Wing, Komodo, Spyder, ... I did a comparison last year (which I can't unfortunately share :( I can ask) -- bottom line, all pretty darn good, each has its strengths and weaknesses. Take away: it's a great time to be a Python dev on Windows (finally?).

WRT to PTVS itself, the key feature is being VS based; the mixed-mode debug for example takes advantage of support in VS. But at the same time, if you're looking for a cross-platform, very very very lightweight tool, this isn't the IDE you're looking for.

[+] int_19h|12 years ago|reply
It really varies from area to area, and each has something that others don't. E.g. PyCharm is unique in supporting Cython, PTVS is now the only one with mixed-mode debugging (don't you wish those two were married in one IDE? ~) etc.

In other areas like code editing, the differences are often qualitative. For example all Python IDEs have code completion, but try entering this in your favorite one:

  def f(x):
      def g(y):
          return x + y
      return g
  
  a = f(1)(2)
  b = f(3.0)(a)
  c = f(u'a')(str(b))
  d = (a, b, c)[input()]
And then see what completions it gives you for a., b. etc.

It would be interesting if some independent third party would do a detailed point by point study and published it.

[+] moron4hire|12 years ago|reply
It's Scott Hanselman's blog. The entire point of it is to proselytize for MS products.
[+] 3327|12 years ago|reply
Surely there must be some out there, but VS is a solid IDE its really hard to argue against it. Eclipse, VS they are benchmarks.
[+] isxek|12 years ago|reply
Question: Why did the PTVS developers eventually adopt the .sln|.*proj file thing that other MS languages (C#, VB) use?

As far as I can remember, there was some resistance to going through that route before (v1.5 didn't have this, I think).

[+] tonyplee|12 years ago|reply
Just Vi or Vim for me. Used VS, VB, Eclips years back, but now back to Vi/Vim for embedded and server environment. Have not missed any of IDE features at all.
[+] MichaelGG|12 years ago|reply
Why not both? http://www.viemu.com/

Get all the editing capabilities of Vim, but don't lose integrated debugging, code completion, code nav, type info popups, etc. that an IDE provides.

[+] antihero|12 years ago|reply
Awesome as this looks, I'm not sure it's worth giving up my entire workflow or having to actually use Windows.
[+] pelemele|12 years ago|reply
It's cool until you see the price tag for Visual Studio Profi/Prem/Ultimate (I assume you can't use Python tools with Express versions). In that case I will stick to my old copy of Visual J++...
[+] int_19h|12 years ago|reply
You can't use it with VS Express, but you can use it with VS Shell (also free) - and we have a single-file installer that will install both Shell and PTVS for you.
[+] jiggy2011|12 years ago|reply
The article mentions that Visual Studio is not required to use this, but all of the downloads I tried from that page tell me to install Visual Studio..

Can somebody point me in the right direction?

[+] Paul12345534|12 years ago|reply
I use Pythonwin for quick and dirty stuff but I absolutely love PTVS for anything else :) I'd never use another Python IDE after I got used to it
[+] jiggy2011|12 years ago|reply
Can this be made to interface well with vagrant?
[+] pipboy3|12 years ago|reply
is there ruby equivalent?