Any one else getting lots of indentation syntax errors when writing python in panics coda IDE? Ive been getting a lot of these, and just shuffling my code around seems gets rid of the error. Bug?
Asked
Active
Viewed 1,939 times
1 Answers
5
This is usually due to shifting between tabs and spaces as tabs. I've set my invisible character color (Preferences -> Colors) to be visible on the page so that I can see if I'm using tabs or spaces. The Python standard is to use 4 spaces for a tab. I've set this as the default as well (Preferences -> Editor then uncheck 'Use tabs' and set tab width to 4). Finally, you can clean up a file that switches between tabs and spaces or is using tabs instead of spaces by selecting the text and then going to the Text menu and selecting Detab.

Kinsa
- 686
- 8
- 14
-
Yup, it seems to have been a problem with mixing tabs and spaces. Haven't had the problem come up again after taking your advice. Thanks for your help! – nicksweet Oct 11 '11 at 03:36
-
Just to elaborate on your answer - uncheck `Use spaces instead of tabs`. Also in order to see invisible characters you have to turn it on under Prefs > Editor. Then make sure you see arrows (representing tabs), not dots (spaces). – Milo Wielondek Sep 13 '12 at 18:25
-
@MiloszWielondek aren't you then telling Coda to use tabs instead of spaces which would contradict PEP 8? – Kinsa Sep 17 '12 at 22:39
-
Seems the only way to make it work. Using spaces accordingly to PEP8 on Coda 2.0.2 I've run into the indentation syntax error problem OP describes above. Nonetheless, the aforementioned workaround seems to do the trick! – Milo Wielondek Sep 19 '12 at 09:28