Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

IndentationError: unindent does not match any outer indentation level?

IndentationError: unindent does not match any outer indentation level?

Anonymous
Not applicable
2,051 Views
3 Replies
Message 1 of 4

IndentationError: unindent does not match any outer indentation level?

Anonymous
Not applicable
Hi!

It may sound like a rookies problem! But i just get Maya 2011 at work and since all my python scripts give me indent problem!

It seems that maya insert space insted of inserting a tab!

Someone have the same problem??
0 Likes
2,052 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
The Python interpreter will recognize spaces or tabs characters. The only gottcha is you must never mix spaces and tabs, pick one or the other. I'd guess that you have mixed them and are unable to tell in the script editor-- The mixing is causing the IndentationError.


The specification (PEP-8) recommends spaces, most developers use spaces, so unless you have a really good reason not to (the file is already in all tabs), I'd say go with spaces. I always edit in an external editor (vim) that inserts only spaces and will highlight tabs characters to warn me.
0 Likes
Message 3 of 4

Anonymous
Not applicable
Great!
That it!
Big thanks to you and your explanation!

really appreciates

j:D
0 Likes
Message 4 of 4

Anonymous
Not applicable
If you must use tabs, you can use the proc:

toggleCommandExecuterTabsForIndent();
0 Likes