19

I am using spyder IDE for python coding. I copied the code from some source,it works fine. But when I make edits in it indentation error occurs. There is always some mistake in the alignment of my edit and the other part of code. Code is quite large I can't re indent it.

Ajay Sunarthi
  • 191
  • 1
  • 1
  • 3
  • 3
    Possibly a mix of tabs and spaces? If that's the case, you can download Notepad++ and use [convert tabs to spaces](http://stackoverflow.com/questions/455037/notepad-convert-tabs-to-spaces) to homogenize your indentations. – Cory Kramer Nov 06 '14 at 13:40
  • 2
    Use `spaces` rather then `tabs`, and don't mix both of these. – Vishnu Upadhyay Nov 06 '14 at 13:42

2 Answers2

45

In Spyder v3.0.0, go to Source --> Fix Indentation. That worked for me.

cpc333
  • 1,493
  • 1
  • 11
  • 10
3

In Spyder v5.3.3, Also, go to Source --> Fix Indentation. That worked for me.

A_B_Y
  • 332
  • 2
  • 8