Visual Studio, Python not auto-indenting
http://stevedower.id.au/blog/smart-indentation-for-python/
However, the most common (and default) mode is “Smart.” Unlike the other two modes, which are built into the editor, smart indentation is provided by a language service (which are also responsible for providing syntax highlighting and completions). Because they are targeted to a specific language, they can help the programmer by automatically adding and removing extra indentation in ways that make sense.
Tools -> Options -> Text editor -> Python -> Tabs
and set it to Smart