10 ms·
Why Write Python in Visual Studio?
- uptownJimmy 11y agoFantastic. I was on the fence about lookng at Python in my spare time. Now I'm bound to do it at some point. VS is amazing.
- ohitsdom 11y agoI'm a .NET developer so to me this is a slam dunk. How does the Python crowd feel though? I'd guess the majority tend to be Microsoft-adverse. Why wouldn't you use VS when it seems to be so ahead of the competition?
- bliti 11y agoWhen you say ahead of the competition, what do you mean? Ive used it before (2005, 2008, 2010), but it was just another IDE. How have things improved?
- bargl 11y ago2013 was a pretty big jump (IMO) for Visual studio. It added some cool features that I use all the time. Filtering in the solution explorer. Peeking definition. Code Lens Parallel watch. (Ultimate Only) Number of references listed above the function and tests associate with it. 2015 has some even cooler stuff. It shows memory and cpu usage as you debug any program (tests/console/etc). You can call linq from the watch window (not sure where I saw this buy a key feature that was missing). The built in diagnostics tools are better (I use resharper so I don't really need that). I also really like some of the built in Code Review tools they have, which you don't need if you do pull requests in git.
- bliti 11y agoI assume those features are strictly for the MS stack. Am I wrong? Do they work with Python? In terms of costs, what do you pay for it (including the OS)?
- bargl 11y agoArgh hate to fess this up but I think some of those features might be locked into MS stack. Just tried on my 2013 version on python and peek wasn't working. Will try 2015 later to see, but I'm not hopeful.
- ohitsdom 11y agoI work in Visual Studio exclusively for my day job the last 8 years so my experience is pretty limited. But every time I try out other languages and IDEs on my own time, I'm almost shocked at how hard the tools are to work with compared with Visual Studio. VS has excellent intellisense. Compile and runtime errors are clearly pointed out, usually with helpful error messages. And real-time debugging and being able to set variable watches make developing much easier. Compine that with the new integrated performance/memory profiling tools and it's a slam dunk. These tools may be available in other IDEs, but they are so easy to use in Visual Studio. Again, this may be due to my experience and familiarity, but I haven't found anything close. In theory Eclipse should be able to compete since the debug capabilities should be the same (.NET vs JVM) but it was disappointing. Cludgy IDE, poor intellisense. And even creating a simple Java console application required several manual configuration steps. In .NET you can have a new console app running in 2 clicks, and it's pretty intuitive so even new users shouldn't be too overwhelmed.
- bmj 11y agoDid you work with other IDEs/languages before you started working with VS? I typically use VS every day (currently on 2013), and yes, I have a similar experience with other IDEs. Then I remember that I know VS pretty well, and maybe that's why this other IDE doesn't seem so great. If I spent 8 years with a different IDE, and someone gave me VS2015, I'd probably have that same "this clearly isn't as awesome as X" feeling.
- gknoy 11y agoI'm not sure. I used Eclipse extensively for several years (though am not an expert), but immediately discarded ANY interest in Eclipse within about 20 minutes of using PyCharm. Because of that experience, I no longer felt that IDEs were interchangeable. I haven't used Visual Studio in about a decade or more, but I would not be surprised if there were things about it that don't have an easy analogue in others, and which people miss.
- oblio 11y agoCreating a Java console app is not really the same as creating a non-portable, Windows only console app. Of course VS does Windows integration better, that's kind of the point :)
- na85 11y agoIntelliSense is pretty good, sure, but emacs is a superior development environment in nearly every other aspect.
- atilaneves 11y ago...And you get can get autocompletion in Emacs as well, so there's that. Before you ask, I use jedi.
- S4M 11y agoI use emacs with jedi too, but the auto-completion is not so good. For example, if my code is: def function1(x): variable1 = x+1 return variable1**2 def function2(x): variable2 = 2*x return 5+v... And I get two auto-completion choices: variable1 and variable2, while only variable2 is logical.
- tcas 11y agoI just tried this example, since anaconda-mode + company (which uses jedi) has been really good for me, it doesn't show variable1 for me. http://imgur.com/4l6Otvt http://imgur.com/4l6Otvt I used to use the auto-complete package instead, which in some configs (with ac-source-words-in-buffer or ac-source-words-in-same-mode-buffers in the source list) basically tokenize the buffer and provide autocomplete on all words.
- S4M 11y agoThank you, I gonna check my settings. This bad autocomplete thing has been a mild annoyance for a while.
- tcas 11y agoYea, the switch from auto-complete to company mode was annoying to get done right, but was well worth it in terms of accuracy. It also provides function signatures which my old setup didn't. I also switched to using virtualenv mode as well. I can probably try and dig up the relevant part of my config, but since I'm using prelude as a base now it mostly just works with only a few lines of tweaking in my personal.el -- mostly just virtualenv locations and enabling virtualenv mode with a hook.
- antihero 11y agoIf they had VS on OSX I'd definitely give it a shot. Unfortunately, they don't, yet.
- robotresearcher 11y agoWorks fine in a Windows VM.
- JustSomeNobody 11y agoOf course it does, but that's not exactly the same thing, now is it?
- dogma1138 11y agowhy not? with parallels or a similar transparent solution why would you care? Heck most modern solutions even setup all the environment variables and paths so you barely even notice that you are on a different file system when you using them.
- tracker1 11y agoHonestly, it's kind of annoying... firing up a Windows VM cuts my battery life significantly. Ubuntu behaves itself. That's just the start... I do a lot of .Net development, and more JS/Node development... I don't miss VS or windows most of the time.
- e12e 11y agoWhy would you pay for two OS licences when you've got an OS you're happy with? Sure, you might choose an OS based on the applications available (eg I strongly preferDebian GNU/Linux because of apt-get and xmonad) -- switching OS to use a tool seems like a bit of a stretch though. If you like the MS toolset, by all means use Windows. But using a vm for especially a gui program (which then interacts poorly with your os ui) seems like a sub-optimal solution?
- rayiner 11y ago
- larrik 11y agoBecause it's Windows-only still...
- grub5000 11y agoIt's actually not: https://www.visualstudio.com/en-us/products/code-vs.aspx https://www.visualstudio.com/en-us/products/code-vs.aspx
- tracker1 11y agoVS Code is much closer to sublime/textmate/atom than it is full Visual Studio... It's actually kind of nice to work with, but is emphatically NOT VS.
- forgotAgain 11y agoVisual Studio Code support for Python is limited to syntax highlighting and bracket matching. So in the context of the article developers are actually limited to Windows only.
- noir_lord 11y agoThat's not remotely like Visual Studio, it's much nearer Atom + some Microsoft Language Support.
- vegabook 11y agoMicrosoft + Python = Ironpython. !Cred.
- sswaner 11y agoI am giving Microsoft some room for redemption for many mistakes made in the Ballmer era. This support for Python in VS may be a step in that direction.
- vegabook 11y agoAgreed. Clearly I'm being unfair, but I think I may not be alone in my aversion to the old Ballmer brands. Perhaps SN should "do an Edge" on the VS moniker.
- josephcooney 11y agoI don't think this has much to do with the change of the guard at the top. Iron Python was started in 2008, and Python tools for VS was first released in 2011.
- devy 11y agoCertainly a no go for developers who work on Macs - as VisualStudio is strictly Windows only still :(
- uptownJimmy 11y agoParallels for Mac is rock-solid. I've been developing professionally with VS and SQL Server Management Studio on a Mac for 1.5 years now, without a hiccup. And VS is amazing.
- politician 11y agoVMware Fusion is also fantastic. The best way to run Windows in my opinion.
- Ycros 11y agoI don't agree that VS is ahead of the competition. In my view the best IDEs in the Python space are PyCharm and WingIDE, and they've both been doing excellent auto-complete, debugging, refactoring, etc. for years. That said, I'll probably try it out.
- bliti 11y agoFor those who have used this: - Does it perform better than PyCharm? - How is Windows working for you as an OS (to develop Python on)?
- czardoz 11y agoI've not used this, but about the second bit: I've developed a few pieces of software on Windows and by far, the most painful thing I had to do install Visual Studio Express to compile some of the C extensions. I used Pycharm on Windows, so it pretty much abstracted away tasks like making virtualenvs, setting up environment variables, etc.
- odonnellryan 11y agoYou're definitely right, sometimes you do need to install odd stuff on Windows to get certain Python packages to work. It has seemed to get better lately. I usually use Windows, and I've been getting along great lately with Python dev work.
- mvid 11y agoI write Python professionally, and it will be pretty hard to get me away from PyCharm. I don't see anything in the blog post that indicates a feature PyCharm doesn't already have.
- TillE 11y ago> a feature PyCharm doesn't already have It's free. I'm sure there are a lot of Python developers who already have a full-featured IDE they love, but then there are also people (like me) who sometimes write Python and just use Sublime Text or Vim. Or even Eclipse.
- compostor42 11y agoJetBrains released a free community version: https://www.jetbrains.com/pycharm/download/ https://www.jetbrains.com/pycharm/download/
- Cyph0n 11y agoThey also provide a free 1 year educational license for all of their products to students.
- zer01 11y agoAs well as discounts if you're a student. IIRC I paid like 25$/year when I was still a student. Easy money to pay with such an awesome product!
- thro1237 11y agoIs there any difference in the code completion for the professional and the community edition. I tried out both and it seemed like some of the code completions only work with the professional edition. Just want to know if this is a bug or a feature :)
- collyw 11y agoAs an Eclipse / Aptana user, can I ask what you think is so bad about it, and what I would benefit from changing? I see plenty of minor issues (mainly in setting up the dev environment), but for most things its good enough. I know it reasonably well, and it has plugins for Perl and SQL which is a nice benefit.
- zwieback 11y agoI like VS but is this fundamentally better than PyDev? I've become accustomed to Eclipse so I get auto-complete and full interactive debugging already.
- ohitsdom 11y agoIn my experience (C# & Java), Eclipse's autocomplete doesn't even come close to Intellisense. Not sure if that gap is any different with Python.
- dimino 11y agoI was going to write a little client library for a REST API my city's transport system exposes, and I think I'll try this out on my gaming PC, rather than my intended plan of writing it on my Macbook. My worry is it's going to create VS-specific files, which I'm adamantly opposed to (or any IDE-specific files, for that matter). We'll see, though. I guess I tolerate the .idea directory already, I just don't want to depend on the VS files, similarly to how I have a .gitignore line for .idea currently. I can't be sure if it's because I already had cygwin installed on my PC prior to my upgrade to 10, but I'm very pleased with the updated cmd.exe. I think I recall ctrl C/P working as expected too! Right now I'm dealing with a weird encoding issue when I SSH to my Ubuntu box from CMD.exe, but I'm sure it's just a setting somewhere I've got to tweak.
- chupapuma 11y agoI am a developer on PTVS. TL;DR - We do have project files but are working to remove that necessity. First, we do have some VS specific files, namely SLN and PYPROJ files. These are unfortunately needed for us to manage your project. We do hope to not need these in the future but we currently need them due to the project system we use in Visual Studio. We do hope to replace this with a different solution eventually. The good news is these files are easily generated and do not need to be saved. If you go to File>New>Project>Python>From Existing Python Code you can generate these by giving a folder. Second, As for the SSH troubles, CMD has been given an overhaul for Win10 and I suspect you are seeing the effect of that. I know they handle encodings differently now so that is probably the issue. I know I have seen some things render a bit strange since my transition to Win10 last week.
- saboot 11y agoI've been using PTVS for about two weeks now. Previously I just used Spyder which shipped with the Anaconda distribution. Some things that annoy me: - Reading intellisense python documentation in the mouse over window is really tedious. There is an object window that can display documentation for your classes, but not from libraries. - Rendered docs are much easier to read. Spyder did this very well. With PTVS I'm looking at the docs online for numpy and matplotlib. With spyder I just ctrl+I and it displays using sphinx very nicely. - I was not able to get IPython to cooperate with displaying plots in separate windows in executing scripts as easy in PTVS compared to Spyder. - Being able to commit and push to github is a great feature. - Spyder had superior debugging features in terms of examining array data throughout the debug process. Make plots just by right clicking the object in the variables window. Very useful for making sure a step for a scientific algorithm is doing what I intended. I'm hoping more features like the above will be added over time. However I'm looking at going back to Spyder + some git plugin or tool, or switching to PyCharm.
- chupapuma 11y agoI am Chris Wilcox, one of the developers on Python Tools for Visual Studio. I am happy you have tried the product and glad you took the time to provide some feedback. We have some pretty decent GitHub support built in to Visual Studio and our tooling. With Visual Studio 2015 we also have a nifty 'Open in Visual Studio' button added to all GitHub pages. As for the other things they aren't complete yet but they are definitely very valid suggestions. If you would file issues on http://github.com/Microsoft/PTVS http://github.com/Microsoft/PTVS we can track them and hopefully keep you posted on the progress to getting them into the product.
- RA_Fisher 11y agoAny chance to change the license over to GPL?
- chupapuma 11y agoShort Answer: No. Longer Answer: We are currently licensed as Apache 2.0 and are satisfied with the constraints of that license. Virtually all products released at Microsoft as OSS are released under MIT or Apache 2.0. We haven't had issues with the license we are using and have no plans to change it. Thanks for your feedback! Also, I hope you enjoyed PyData Seattle! (just came across your Twitter handle and noticed a few photos)
- drglitch 11y agoI've met Steve and his team mates at the last PyCon - the team is very knowledgeable, approachable, and most of all enthusiastic about their project. Having been using Python professionally for about 8 years now, i've been playing with PTVS and finally think its ready for public consumption - if you've tried it more than 9 months ago, be sure to try again - it is lightyears better, especially when it comes to things like remote debugging and managing venvs. Documentation is still a bit lacking here and there when it comes to getting PTVS to play nicely with other debuggers like pdb and werzkeug, but overall, i cant wait to see the project and the team continue on this effort.
- stillsut 11y agoI work at a .Net shop and wanted to build a developer tool with python for my colleagues. None of them have a python interpreter so it needs to compile to an .exe I've googled for hours on how to do this with IronPython but the information is incredibly sparse and outdated. Is there any way to do this currently?
- JoshMnem 11y agoI don't want to be forced to login to software before I use it. Also, Microsoft can't be trusted. Look at the keylogger in Windows 10, for example. PyCharm is a good Python IDE. You can get a lot of these features in Emacs (or try Spacemacs), or Vim, or Sublime (with plugins).
- Permit 11y ago>I don't want to be forced to login to software before I use it. Then don't, you don't have to log in. That's just to help roam your settings and hook up to Azure if you've got an account. If you don't want these features, just click "Don't Sign In".
- JoshMnem 11y agoI didn't see an option not to sign-in on my last two attempts at installing it. I will check again now. It says 28 Gb of my hard drive needs to be used for this IDE if I check all the boxes during install.
- partiallypro 11y agoYou mean the "keylogger" than only tracks search queries & auto-correct to better optimize algorithms, which Google and Apple both do. Sure. You also don't -have- to sign in. So your post is just nonsense.
- FilterSweep 11y agoBits and pieces of both your comments are correct..... Apple and Google are both complicit in it as well. the issue with your comment is "only" - sure, they're optimizing algorithms, but its a symptom of not reading Terms & Conditions to believe they aren't also associating your search query with some sort of identifier. It's too easy not to implement this.
- JoshMnem 11y agoYou don't have to sign in to use Visual Studio? I've downloaded it twice and didn't see a way to use it without signing in. If it's there, it's hidden. Windows 10 sends your typed text to remote servers. That's a keylogger. You can opt out, but most users won't. Other companies do it and I criticize them too.
- Rapzid 11y agoI have two questions in my head: 1.) Is the foundational work that has gone into this going to be used to help support intellisense in other languages in the future? 2.) Will any of this make it into Visual Studio Code?
- dogma1138 11y agoPython had intellisense support both officially (through MSFT) and non-officially through community addins since VS2003, MSFT has support since 2005 with working examples. VS Code doesn't really have "intellisense" it's a nice fork of ATOM but considering just how much of an amazing development environment VS is i feel like having Code under the same brand devalues it quite a bit. Visual Studio also has support for Ruby, Node and virtually every other language out there from LoLCode to Scala the only real downside of VS is that it's not multi-platform, but outside of Silicon Valley you won't find that many software houses that develop on Mac's or Linux machines that often either.
- sandGorgon 11y ago>but outside of Silicon Valley you won't find that many software houses that develop on Mac's or Linux machines that often either. That's patently untrue - Linux is extremely, extremely popular all over India. All major laptop manufacturers (Dell, Lenovo, Asus, Acer) sell laptops with pre-installed Linux. Unfortunately, Macs are getting pretty popular here - even though they are double in cost.
- vegabook 11y agoIndeed - Why?? IronPython. Might trick me once... won' let u trick me twice.
- RA_Fisher 11y agoAnd one really great reason not to use it, the license. At any point they can yank it away from you, why invest time into learning something like that?
- blackbeard 11y agoThey have made at least two attempts to do that in the past as well with dropping the cheap versions of visual c# 2003 and then trying to yank the desktop version of visual studio 2013 express so a fair observation. Plus I think you have to sign in now to maintain your license in community edition and the SDK is no longer standalone.
- kelvin0 11y agoLast time I tested PTVS, running any simple script was 100x slower than running it within Wing IDE (professional) which I was I used 99% of the time. This pretty much killed the idea of using Python in VS, unfortunately (for me anyways).
- smortaz 11y agohi smortaz, project lead for PTVS. i'd love to get a pointer to the script (or repro). this should definitely not be the case! sorry about your experience.
- smortaz 11y agoIf you want to get a feel for what PTVS is like, you can watch these short videos: https://www.youtube.com/playlist?list=PLReL099Y5nRdLgGAdrb_YeTdEnd23s6Ff https://www.youtube.com/playlist?list=PLReL099Y5nRdLgGAdrb_Y... 10k foot view web page: https://www.visualstudio.com/en-us/features/python-vs https://www.visualstudio.com/en-us/features/python-vs if you want to get a feel for an advanced feature, try: https://www.youtube.com/watch?v=wvJaKQ94lBY https://www.youtube.com/watch?v=wvJaKQ94lBY
- bernardvds 11y agoPrior to Python I used to work with Visual Studio (C# and VB) and loved it - especially the ease of designing great-looking GUIs and ease of access to API documentation. But the half-baked integration of VS with Python or IronPython, and the slow/clunky evolution of PTVS has put me off Microsoft tooling for good. Python is a great language for nimble development - locking yourself in to Microsoft's whim messes up with that, unfortunately.