How to prevent indentation errors? I added a line and am very sure there is no indentation problem. Here is the error report and screenshots of the text so you can see it:


  Error: File "C:\Users\info\Desktop\Claas UI.blend\Claas_UI_2.py", line 40
      bpy.ops.object.mode_set( mode = 'EDIT' )
  
  TabError: inconsistent use of tabs and spaces in indentation
  location: :-1
  
  Error: Python script fail, look in the console for now...





When I remove the line with the arrows and uncoment the previous lines below it all runs fine.



Any idea what causes this?
Python doesn't like inconsitently mixed tabs and spaces for indentation.
Ctrl-T opens the property panel, check that the Tabs as Spaces is ticked.
You can usually fix this by unindenting the lines in question by Shift-Tab to the first column and re-indent them Tab again.

There is also the menu option available  Format &gt; Convert Whitespace &gt; To Spaces  (or to tabs)
Related:

https://stackoverflow.com/questions/5685406/inconsistent-use-of-tabs-and-spaces-in-indentation