automatic Convert Whitespace To Tabs, please

For the love of god, is there an automatic “Convert Whitespace To Tabs” feature anywhere for Blender’s Script Editor?

If I add anything to a python script in Blender, I “”"""“WILL”""""" get an TabError or IndentationError unless I manually go Format -> Convert Whitespace -> To Tabs every single time.

Blender’s Script Editor is the devil. I can’t take this anymore.

uncheck “tabs as spaces” in the ctrl-t panel in the editor, or in user preferences where the file location stuff is.

i only ever use notepad and use module mode. problem solved.

Might I suggest you don’t take it any more and stop using tabs :smiley:

‘Spaces are the preferred indentation method.’ - https://www.python.org/dev/peps/pep-0008/

There is an option in the t panel (or should I say ctrl+t panel in text editor :smiley: ) Tabs as Spaces. That should avoid Python errors.

Bleh, I still get indentation errors trying both of your guys solutions.

I think the thing is that I inadvertently mix spaces and tabs no matter what and Blender’s Script Editor can’t cope. Funny how this never happens when I write scripts using IDLE :confused:

4 spaces are always better than 1 tab. I’d rather convert all my tabs into 4 spaces instead of converting spaces into tabs.

Because luckily, your IDE converts tabs into spaces when you try to run the program. Blender doesn’t.

You can get indentation errors because of bad indentation as well. I would suggest you try to adjust your attitude towards coding and accept that a good coder will write code as it is supposed to be written. In this case, in Blender Python code is supposed to be written with spaces and for spaces you should use your space bar even though you can use tab if you check that one checkbox. How are you coping with all the other hundreds of not thousands of rules coding requires you to obey? Well, here is your answer - you have to apply that very same method to spaces as well. It’s just another rule.