Python plugin for Visual Studio released

What features Python Tools for Visual Studio plugin brings for a coder? 
01 August 2017   680
Python

Multi-paradigm programming language with easy-to-use syntax and many features including the support of the object-oriented and structured programming.

Visual Studio is one of the most popular integrated development environment, created by the Microsoft. This product allow you to develop both console applications and GUI applications, including those that support Windows Forms technology, as well as Web sites, web applications, web services in both native and managed codes for all platforms, that are supported by Windows, Windows Mobile, Windows CE,. NET Framework, Xbox, Windows Phone. NET Compact Framework and Silverlight.

Visual Studio supports these programming languages:

  • Basic
  • C#
  • C++
  • F++
  • JScript

But now, Python support also can be included by a simple plugin.

Python Tools for Visual Studio is a free, open source plugin that turns Visual Studio into a Python IDE.

Django

A high-level, free and open source Python Web framework that encourages rapid and clean development with  pragmatic design.

Features:

  • CPython,
  • IronPython,
  • editing,
  • browsing,
  • IntelliSense,
  • mixed Python/C++ debugging,
  • remote Linux/MacOS debugging,
  • profiling, IPython, 
  • web development with Django and other frameworks.

From the Visual Studio 2017 installer, select the Python or Data Science workload to add Python support to Visual Studio.

If you will face any issues, don't hesitate to contact developers via GitHub issue. Also, don't forget to check documentation

Designed, developed, and supported by Microsoft and the community.

What is YAPF?

A formatter for Python files, developed by Google team
30 October 2017   441

What is YAPF?

Most of the current formatters for Python --- e.g., autopep8, and pep8ify --- are made to remove lint errors from code. This has some obvious limitations. For instance, code that conforms to the PEP 8 guidelines may not be reformatted. But it doesn't mean that the code looks good.

YAPF takes a different approach. It's based off of 'clang-format', developed by Daniel Jasper. In essence, the algorithm takes the code and reformats it to the best formatting that conforms to the style guide, even if the original code didn't violate the style guide. The idea is also similar to the 'gofmt' tool for the Go programming language: end all holy wars about formatting - if the whole codebase of a project is simply piped through YAPF whenever modifications are made, the style remains consistent throughout the project and there's no point arguing about style in every code review.

The ultimate goal is that the code YAPF produces is as good as the code that a programmer would write if they were following the style guide. It takes away some of the drudgery of maintaining your code.

Code examples

YAPF takes this code:

x = {  'a':37,'b':42,

'c':927}

y = 'hello ''world'
z = 'hello '+'world'
a = 'hello {}'.format('world')
class foo  (     object  ):
  def f    (self   ):
    return       37*-+2
  def g(self, x,y=42):
      return y
def f  (   a ) :
  return      37+-+a[42-x :  y**3]

and reformat it into:

x = {'a': 37, 'b': 42, 'c': 927}

y = 'hello ' 'world'
z = 'hello ' + 'world'
a = 'hello {}'.format('world')


class foo(object):
    def f(self):
        return 37 * -+2

    def g(self, x, y=42):
        return y


def f(a):
    return 37 + -+a[42 - x:y**3]

See GitHub for more information.