How to use tabs-as-spaces in Python in Visual Studio 2008?

ironpython, python, visual-studio, visual-studio-2008

Solution

Here is one way to do it, probably not the best. On the Tools -> Text Editor -> File extension part of the Options menu add a .py extension, and set an type of editor. You don't get a python editor type, but you can pick one of the ones you use less often (for me this would be VB.net), and then make sure that the tab settings for that language fit your needs. Syntax highlighting didn't seem to be affected for me.

Problem

I have some IronPython scripts that are embedded in a C# project, and it would be convenient to be able to edit them in the VS editor. VS evidently knows about Python because it provides syntax coloring for it. Unfortunately however the editor uses tab characters for indentation, whereas I want spaces. Is there a setting to change this? I don't see a heading for Python under Tools/Options/TextEditor.

Original source